Reputation: 823
I need to execute the same maven plugin more than once in the same phase.
What I want:
Execution order when I define the plugins sequentially (same order as above):
My solution is to combine all executions in my own plugin to control the exact order, but I don't think it's the best way to do it. Thanks !
Upvotes: 2
Views: 826
Reputation: 1081
Do you absolutely have to run the plugins during the same exact phase? Can't you use some other related phase? Maven has a lot of phases nowadays :) e.g. "prepare-package" vs. "package". I would probably try to define multiple executions for the plugin like this (bwt this is not a real-world scenario):
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>assembly1</id>
<goals>
<goal>assembly</goal>
</goals>
<phase>prepare-package</phase>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</execution>
<execution>
<id>assembly2</id>
<goals>
<goal>assembly</goal>
</goals>
<phase>package</phase>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</execution>
</executions>
</plugin>
Not sure if it will work for your desired order though. Might be worth a try.
Upvotes: 2