[英]Maven executing configured plugin
Under Maven version 3.0.4
I have the problem to specify the execution of a single configured plugin. 在Maven版本
3.0.4
我遇到了指定单个已配置插件执行的问题。 Say I have two different configured maven-antrun-plugins. 假设我有两个不同的配置的maven-antrun-plugins。 Both are in the same lifecycle.
两者处于同一生命周期。 How can I target the plugin I want to execute without using different lifecycles?
如何在不使用不同生命周期的情况下定位要执行的插件? Since version
3.3.1
it's possible to do it in this form: mvn groupid:artifactid:goal@id
Is there a way to do this in a similar way in version 3.0.4 or lower? 从
3.3.1
版开始,可以用以下形式进行操作: mvn groupid:artifactid:goal@id
在3.0.4版或更低版本中,有没有一种类似的方法?
You can use the "default-" in your pom to have the first plugin running during the default lifecycle (since Maven 2.2.0), and use a classifier for the second plugin, for example with the maven jar plugin, you can see the example below: 您可以在pom中使用“ default-”在默认生命周期(自Maven 2.2.0起)中运行第一个插件,并为第二个插件使用分类器(例如,与maven jar插件一起使用),您可以看到下面的例子:
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<id>default-jar</id>
<configuration>
<excludes>
<exclude>**/somepackage/*</exclude>
</excludes>
</configuration>
</execution>
<execution>
<id>special-jar</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<includes>
<include>**/sompackage/*</include>
</includes>
<classifier>somepackage</classifier>
</configuration>
</execution>
</executions>
</plugin>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.