On 11/21/06, Christian Goetze <[EMAIL PROTECTED]> wrote:
Wayne Fay wrote:
> Its a chicken and egg problem.
>
> If you don't hard-code parent version in child = which parent version
> should I use? Keep in mind the /parent/module layout in the filesystem
> (with relativePath) is not an absolute requirement ie parent poms
> could/should be checked into a Maven repo and resolved from there. The
> fact that ../pom.xml "usually" works to find the parent is just an
> enhancement to the functionality.
>
> So assuming I have 3 parent pom versions in my Maven repo, how does
> Maven know which one is "right" without being told?
>
It could be told by setting -Dmy_version=<version> and using
${my_version} in the parent reference. But not even that works.
You're missing the point. A child pom MUST be able to know what version its
parent is BEFORE it can inherit anything. Wayne is right... it's strickly a
chicken-and-egg problem. Its a very bad design to create a project that
requires a parameter from the command-line to decifer its actualy
coordinates... you'd have to type in the version EVERY TIME you used it. So
rather than:
mvn install
You users must enter:
mvn install -DmyVersion=1.0-alpha-1-SNAPSHOT
You're not really gaining anything here.
Eric
--
cg
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Eric Redmond
http://codehaus.org/~eredmond <http://codehaus.org/%7Eeredmond>