我對詹金斯輸出有點困惑。對詹金斯Maven配置文件 - 如何爲父級運行插件一次以及爲模塊運行更多插件?
工作:(底部縮短的pom.xml)
mvn deploy -Pprofile1
我所有的插件將運行4次:
- 父/ pom.xml的
- 父/模塊1/pom.xml
- parent/module2/pom.xml
- parent/module3/pom.xml
我需要:
- 第一Maven的插件:只有在父pom.xml中運行一次
- 第二Maven的插件:運行每 POM .xml
Why:
- first-maven-plugin:將運行在階段:初始化 - >相當長的清理操作。不要這4次
- second-maven-plugin:將運行在階段:包 - >所有pom的necesaary。
父pom.xml的
<project ...>
<groupId>com.test.parent</groupId>
<modelVersion>4.0.0</modelVersion>
<artifactId>parent</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<name>parent</name>
<modules>
<module>module1</module>
<module>module2</module>
<module>module3</module>
</modules>
<profiles>
<profile>
<id>profile1</id>
<build>
<plugins>
<plugin>
<groupId>com.test.plugin</groupId>
<artifactId>first-maven-plugin</artifactId>
<version>1.0.0-SNAPSHOT</version>
<execution>
<id>execution1</id>
<phase>initialize</phase>
<goals>
<goal>doit</goal>
</goals>
</execution>
</plugin>
<plugin>
<groupId>com.test.plugin2</groupId>
<artifactId>second-maven-plugin</artifactId>
<version>1.0.0-SNAPSHOT</version>
<execution>
<id>another</id>
<phase>package</phase>
<goals>
<goal>goforit</goal>
</goals>
</execution>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
做這兩個插件有任何'skip'選項? –
插件沒有跳過選項。它們是通用的,因爲它們可以在多個項目上運行。 –