Could you learn a little more about the problem you are facing? Do you have any errors?
I already used this definition of a recursive property in one of my pom.xml , in the antrun <configuration> plugin, and it works well:
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <version>1.2</version> <executions> <execution> <phase>package</phase> <goals> <goal>run</goal> </goals> <configuration> <tasks> ... <ftp server="${my-ftp-url}" userid="${ftp-${appli}-${env}-username}" password="${ftp-${appli}-${env}-password}" remotedir="${remoteDir}/sources" passive="yes"> <fileset dir="../target/"> <include name="*.tar.gz"/> </fileset> </ftp> ...
As you can see in this code snippet, I use the property ${ftp-${appli}-${env}-username} , where ${appli} , ${env} and ${ftp-xxx-yyy-username} - These are properties that come from the command line or settings.xml .
In any case, as suggested by Yevgeny Kuleshov, I would take a set of <profiles> , which only defines some properties using <properties> tags or an external properties file:
<build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>properties-maven-plugin</artifactId> <version>1.0-alpha-1</version> <executions> <execution> <phase>initialize</phase> <goals> <goal>read-project-properties</goal> </goals> <configuration> <files> <file>${basedir}/${env-properties-file}</file> </files> </configuration> </execution> </executions> </plugin> </plugins> </build> ... <profiles> <profile> <id>dev</id> <activation> <activeByDefault>true</activeByDefault> <property> <name>env</name> <value>dev</value> </property> </activation> <properties> <env-properties-file>dev-environment.properties</env-properties-file> </properties> </profile> <profile> <id>hom</id> <activation> <activeByDefault>false</activeByDefault> <property> <name>env</name> <value>hom</value> </property> </activation> <properties> <env-properties-file>homologation-environment.properties</env-properties-file> </properties> </profile> ...
source share