Maven: Using different plugin configurations on e.g. deploy -
for android maven project (consisting out of parent project consists out of main apk project , test project), able use different plugin configurations building whole project.
i know can profiles, there other options?
the thing achieve execute deploy "mvn deploy" , use different plugin configuration, should used if deploy (or release) taking place.
a concrete example increase android version code if deploy takes place. binding increase of version code directly deploy phase not work increased version code needed before process-resources phase work properly.
i'm afraid maven profiles option.
you add enforcer check on deploy
phase fail build if profile not active:
<plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-enforcer-plugin</artifactid> <version>1.2</version> <executions> <execution> <phase>deploy</phase> <!-- enfoce rules on `mvn deploy` --> <goals> <goal>enforce</goal> </goals> </execution> </executions> <configuration> <rules> <requireactiveprofile> <profiles>prod</profiles> <!-- require `-pprod` --> </requireactiveprofile> </rules> </configuration> </plugin>
Comments
Post a Comment