[英]Maven: run plugin twice during a phase, interleaved with another plugin
[英]Maven tell plugin to not run during phase
我可以使用任何阶段来阻止 Maven 运行插件目标,或者我可以通过任何其他方式告诉 Maven 跳过插件目标吗? 基本上,我只想手动运行它。
<groupId>com.googlecode.maven-download-plugin</groupId>
<artifactId>download-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<phase >pre-integration-test</phase>
<goals>
<goal>wget</goal>
</goals>
</execution>
</executions>
<configuration>
<outputDirectory>${project.build.directory}/output</outputDirectory>
<url>http://some.url</url>
<outputFileName>filename</outputFileName>
</configuration>
</plugin>
当我使用 pre-integration-test 时,它会在 mvn install 期间运行。 但是,我只想手动运行它。
Phase none
适用于我的场景,以防止为我的多模块 Maven 项目中的特定模块创建测试 jar。 像这样:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>test-jar</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.