3

how can maven using nested properties definition ?

<groupId>org.sonatype.mavenbook.simple</groupId>
  <artifactId>simple</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>pom</packaging>
  <name>simple</name>
  <url>http://maven.apache.org</url>
  <properties>
  **<TEST-1.0-SNAPSHOT>hello world</TEST-1.0-SNAPSHOT>
  <test>${TEST-${project.version}}</test>**
  </properties>

I defined a property TEST-1.0-SNAPSHOT which use the ${version} be part of the property name then I want to use the ${TEST-${project.version}} to refer to the property content。

who can help me ? thanks anyway !

Haoran Wang
  • 149
  • 1
  • 9
  • 1
    first why do you need that ? and why not using *TEST-${project.version}* ? – khmarbaise Apr 23 '13 at 06:39
  • the property TEST-1.0-SNAPSHOT is define in the parent pom characterized by name-${version} ,I want to get the value "hello world" . – Haoran Wang Apr 23 '13 at 08:15
  • That's as far as i know not possible. the question is why you need such things.Can you elaborate that a little bit more? – khmarbaise Apr 23 '13 at 08:41
  • I want to define planning a group of properties that will using for each module and each branches, in the parent pom.xml ,using team-project.version format, so the child module can using the property .I have find a method using a plugin named org.codehaus.gmaven gmaven-plugin then i can using ${test} directly .thanks anyway,thanks! – Haoran Wang Apr 23 '13 at 09:31

0 Answers0