In parent POM, I have:
<pluginManagement>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>execution 1</id>
...
</execution>
<execution>
<id>execution 2</id>
...
</execution>
<execution>
<id>execution 3</id>
...
</execution>
</executions>
</plugin>
<pluginManagement>
My questions are:
<execution>
in sub-projects, e.g, only run execution 3
and skip 1 and 2?exection 4
in my sub-projects
and I want only run this execution
and never run execution 1,2,3 in parent POM.A quick option is to use <phase>none</phase>
when overriding each execution. So for example to run execution 3 only you would do the following in your pom:
<build>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>execution 1</id>
<phase>none</phase>
...
</execution>
<execution>
<id>execution 2</id>
<phase>none</phase>
...
</execution>
<execution>
<id>execution 3</id>
...
</execution>
</executions>
</plugin>
...
</plugins>
...
</build>
It should be noted that this is not an officially documented feature, so support for this could be removed at any time.
The recommend solution would probably be to define profiles
which have activation
sections defined:
<profile>
<id>execution3</id>
<activation>
<property>
<name>maven.resources.plugin.execution3</name>
<value>true</value>
</property>
</activation>
...
The in your sub project you would just set the required properties:
<properties>
<maven.resources.plugin.execution3>true</maven.resources.plugin.execution3>
</properties>
More details on profile activation can be found here: http://maven.apache.org/settings.html#Activation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With