maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "KARR, DAVID" <>
Subject store file in top parent pom, along with property pointing to it, and ref that property in child poms
Date Fri, 25 Jan 2013 18:31:08 GMT
My project uses a small hierarchy of parent poms.  I believe it would be a good idea to set
my Sonar connection settings in the top parent pom, instead of telling all the users to add
a certain set of settings to their ~/.m2/settings.xml.  In addition, we're using the "sonar.secretKeyPath"
property, along with a specific secret key file.  Continuing this strategy, it would make
sense to store that file in the top parent pom project and set the property to refer to that

My problem is that I can't figure out how to set a path property that is relative to the top
parent, but when referenced from child poms it goes to the correct place.  If I just use the
obvious "${basedir}/sonar-secret.txt" that ends up being relative to the project referencing
the property.

I don't want child projects to need to know how deep the pom hierarchy is, in case there was
some way to do something like "parent.parent....".

I do think it's ok to specify a unique property that specifies where the "root" pom is, and
reference things from that, but I can't figure out how to do something useful with that idea.
 I tried defining that property ("root.parent", for instance) in the top pom and giving it
a value like "${basedir}", and then having the additional property be "${root.parent}/sonar-secret.txt",
but that doesn't fool it.  I really need a "statically-defined" property that references "${basedir}",
so when child poms reference it, it doesn't evaluate it dynamically.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message