On 11/22/06, Christian Goetze <[EMAIL PROTECTED]> wrote:


>>
>> 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.

Yes you are, because you can modify what "mvn" is and add it to the
wrapper script. You can then use whatever method pleases you to
determine the current version number.

The main point here is that one would like to have -exactly- -one- place
where version numbers are defined and changed. Forcing people to
manually edit dozens of pom.xml files every time the version number
changes is just bad design.


Maven does several things... one of which is building, but the other is to
gently (OK, maybe not THAT gently) push users to adhere to standards. It is
not by accident that non-standard behaviors are untenable. The standard in
this situation you describe is to use the maven-release-plugin. I know, I
know... doco sucks - we're working on it.

Before you think this this is an isolated weakness on the part of Maven,
note that this kind of push is happening all over, and once you learn the
standard you see how nice it is to be able to go to any project built with
Maven and be able to use and navigate through it. This is a similar thought
behind Ruby on Rails, and clones like Trax... convention over configuration.
Users shouldn't HAVE to know that in your super-special build system, they
have to type "mvn install -DmyVersion=1.0-alpha-1-SNAPSHOT" to use it.

Eric

--
cg


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
Eric Redmond
http://codehaus.org/~eredmond

Reply via email to