jay*_*hao 14 maven-2 pom.xml maven
(也发布在maven用户身上)
想知道是否有人可以了解pom.xml中与资源处理和WAR插件相关的元素继承.
pom [1]的文档的资源列在"合并的POM中的元素"下.我对当地poms对maven 2.2.1的一些实验似乎没有表现出这种行为.我看到它看起来像子项目(在多模块构建中)继承,但如果这些项目中的任何一个有自己的块,它将替换父项,而不是合并.那是对的吗?
例:
parent-pom.xml
|
|-> child-pom.xml
Run Code Online (Sandbox Code Playgroud)
以下工作正如我所期望的那样,dev中的文件未包含在最终WAR中.
家长的pom.xml
<resources>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>${dev-config.path}</exclude>
</excludes>
</resource>
</resources>
Run Code Online (Sandbox Code Playgroud)
儿童的pom.xml
<resources>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>${dev-config.path}</exclude>
</excludes>
</resource>
<resource>
<directory>src/main/rules</directory>
</resource>
<resource>
<directory>src/test/rules</directory>
</resource>
</resources>
Run Code Online (Sandbox Code Playgroud)
对子进行以下更改(删除src/main/resources的任何声明)似乎导致在进程资源期间不考虑src/main/resource,而不是像我期望的那样从父进程继承.
儿童的pom.xml
<resources>
<resource>
<directory>src/main/rules</directory>
</resource>
<resource>
<directory>src/test/rules</directory>
</resource>
</resources>
Run Code Online (Sandbox Code Playgroud)
[1] http://maven.apache.org/guides/introduction/introduction-to-the-pom.html s
归档时间: |
|
查看次数: |
9602 次 |
最近记录: |