maven does not support property expansion in the following pom nodes: /project/parent/* /project/groupId /project/artifactId /project/version /project/packaging
this is because it is necessary to construct the project model before property substitution can take place, and properties in these nodes can give a *circular* infinite loop. Some versions of maven incorrectly substitute *system* properties (i.e. ones specified on the command line via -D) but that is a bug. Incidentally, this is also why property based profile activation only works for *system* properties. -Stephen On 24 August 2010 06:41, Anurag Kumar Nilesh <[email protected]> wrote: > Hi, > > > > I have defined a parent pom.xml (as shown below) in which I give values to > some variables which are accessed in the children pom.xml > > > > <properties> > > <PeblVersion>2.0.0</PeblVersion> > > </properties> > > > > Then, in the children pom.xml I have written these lines. > > <project> > > <parent> > > <groupId>yahoo.yinst.tetris</groupId> > > <artifactId>tetris-pebls-root</artifactId> > > <version>1.1</version> > > <relativePath>../root/pom.xml</relativePath> > > </parent> > > … > > <version>${PeblVersion}</version> > > … > > <phase>deploy</phase> > > <goals> > > <goal>exec</goal> > > </goals> > > <configuration> > > <executable>find</executable> > > <commandlineArgs>pkg -name "*.yicf" -exec yinst_create -r -c > -target_dir target {} ;</commandlineArgs> > > </configuration> > > … > > > > So, when I run mvn deploy it finds a .yicf file in pkg folder and tries to > execute the commands written in it. > > The .yicf file contains this line > > POMVERSION = `xpath pom.xml //project/version 2>/dev/null | awk -F'[<>]' > '{print $3}'` > > > > The output I expect is “2.0.0” but instead I am getting “${PeblVersion}” > which means the value didn’t get replaced yet in the children pom.xml. > > > > How can I resolve this issue? > > >
