I am trying to pass maven properties (defined through profiles) to a antrun execution:
You can pass the properties by defining new Ant properties (using the property
tag in your target
within the configuration
). So for example:
4.0.0
com.test
test-module
test-module
SNAPSHOT
false
customProfile
true
org.apache.maven.plugins
maven-antrun-plugin
1.7
compile
compile
run
When I execute mvn compile
on this pom the output is:
main:
[echo] Custom Ant Property is: false
[echoproperties] #Ant properties
[echoproperties] #Thu Aug 08 17:17:30 CEST 2013
[echoproperties] ant.project.name=maven-antrun-
[echoproperties] ant.version=Apache Ant(TM) version 1.8.2 compiled on December 20 2010
[echoproperties] antProperty=false
and when the command is mvn -PcustomProfile compile
then the output is:
main:
[echo] Custom Ant Property is: true
[echoproperties] #Ant properties
[echoproperties] #Thu Aug 08 17:18:30 CEST 2013
[echoproperties] ant.project.name=maven-antrun-
[echoproperties] ant.version=Apache Ant(TM) version 1.8.2 compiled on December 20 2010
[echoproperties] antProperty=true
This works using maven 3.0.5.