Vla*_*eev 7 inheritance build maven-plugin pom.xml maven
我pluginManagement
在我的父母中使用元素pom.xml
为其所有子节点配置插件.例如,我有以下配置:
<pluginManagement>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4.3</version>
<executions>
<execution>
<id>copy-artifacts</id>
<phase>install</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>some/where/else</outputDirectory>
<resources>
<resource>
<directory>some/another/resource</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>install</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>deps/dir</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
</pluginManagement>
Run Code Online (Sandbox Code Playgroud)
官方文档指出pluginManagement
仍然必须将配置的插件添加到plugins
子poms中的元素中.事实上,如果我从孩子pom中删除它:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
</plugin>
Run Code Online (Sandbox Code Playgroud)
然后maven-dependency-plugin
在install
阶段停止射击.但是,似乎它不会影响其他一些插件,即maven-resource-plugin
.即使我没有
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
</plugin>
Run Code Online (Sandbox Code Playgroud)
在我的孩子pom中,它的copy-resources
目标仍然在install
阶段激发并执行它配置的工作.
为什么会出现这种行为?是否有一个总是继承的插件列表,或者我可能遗漏了什么?
归档时间: |
|
查看次数: |
5386 次 |
最近记录: |