Jef*_*rey 15 resources maven-2 pom.xml
我有一个超级pom定义,我在其中指定资源的"资源"目录.在我的一个项目中,我的pom扩展了那个超级pom,我想添加一个额外的资源.我试过了:
<resources>
<resource>
<targetPath>/</targetPath>
<directory>additionalDir</directory>
</resource>
</resources>
Run Code Online (Sandbox Code Playgroud)
但这导致只有 extraDir在资源中并且不包括超级pom的资源.有没有办法扩展超级pom的资源?
Mik*_*ell 15
您所描述的行为是预期的.
请记住,您的超级POM继承自Maven的默认POM,并且几乎您在pom中定义的任何插件都会有效地覆盖默认POM中的设置.例如,要启用对默认资源的过滤,您必须在POM中指定路径.你做这个:
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
Run Code Online (Sandbox Code Playgroud)
不是这个:
<resources>
<resource>
<filtering>true</filtering>
</resource>
</resources>
Run Code Online (Sandbox Code Playgroud)
默认目录不会为您冒泡,即使您已在那里指定它.可能有一个特殊的MOJO为你做,但我找不到一个.
归档时间: |
|
查看次数: |
19934 次 |
最近记录: |