Currently running into a weird problem with a Maven build that is making a call to ant, within the parent pom the following property is defined: -
<jboss.home>${env.JBOSS_HOME}</jboss.home>
I am trying to override this by passing in -Djboss.home when I run Maven.
This build contains a profile that when activate calls an Ant build: -
<ant antfile="build.xml" inheritRefs="true">
<target name="all"/>
</ant>
The Ant script uses the property: -
<property name="jboss.dir" value="${jboss.home}"/>
An subsequently outputs it: -
<echo message="jboss dir is: ${jboss.dir}"/>
The problem is that the value it output is ${env.JBOSS_HOME}
Other properties in the parent pom I can override from the command line.
Even the jboss.home property does appear to be overridden if use elsewhere within the Maven build.
After trying various combinations of command it almost appears that the set of properties passed to Ant are resolved from the poms BEFORE any overrides from the command line. If I set the JBOSS_HOME environment variable then all places this variable is used have the correct values.
Is there something I am missing to be able to override this variable on the command line and have the overridden value used in the Ant script?