Using profiles (as little as possible) and a run time, you can achieve what you want for plugins that do not handle the skip property:
Plugin Configuration:
<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>rpm-maven-plugin</artifactId> <executions> <execution> <phase>${rpmPackagePhase}</phase> <id>generate-rpm</id> <goals> <goal>rpm</goal> </goals> </execution> </executions> <configuration> ... </configuration> </plugin>
Profile Configuration:
<profiles> <profile> <id>default</id> <activation> <activeByDefault>true</activeByDefault> </activation> <properties> <rpmPackagePhase>none</rpmPackagePhase> </properties> </profile> <profile> <id>rpmPackage</id> <activation> <property> <name>rpm.package</name> <value>true</value> </property> </activation> <properties> <rpmPackagePhase>package</rpmPackagePhase> </properties> </profile> </profiles>
Vocation:
mvn package -Drpm.package=true [...]
source share