Hi,

I have the same problem. If you use the Maven release plugin (mvn
release:prepare and mvn release:perform) it will ask you for each version
number for the release and for the version number after the release. That
makes it a bit easier, although he will ask you for each project, so you
will have to enter that 50 times * 2 (release version and new version for
trunk). To use this, you will have to follow the pattern of using
1.0-SNAPSHOT in trunk and then he will suggest a release version of 1.0 and
a new version number of 1.1-SNAPSHOT. But if you want to do it differently
from that, it gets difficult and you will have to manually modify the POMs.

Maven is simply not flexible: if you do not follow Maven's conventions you
won't get good results. The advantage of ant is that you can easily modify
and tweak things so that they work for you. I see two good points in Maven:
a) global repositories and automatic downloading of libraries, and b) all
Maven projects look the same, once you know it, you know all.

Well, back to the problem: What might be possible, and what I want to try
now, is to set a version number in the root pom only and remove the version
number declaration in all other poms. So there would be only one number (and
one file) you'd have to change for that. The open question is what to do
with dependencies: if you have 50 modules you probably have a lot of
cross-dependencies between your modules. Which version number should one
enter here? None as in the module declaration? I don't know if that works.
If not, one would have to set a global property like myproject.version and
reference it everywhere with <version>${myproject.version}</version>.

I found similar things on the web but nothing that explains if that really
works.

Alex


Mick Knutson-4 wrote:
> 
> I have over 50 modules in my project and they all have headers like:
> 
>     <groupId>org.delta.esp.dap.c2.services</groupId>
>     <version>1.0.0.0</version>
>     <artifactId>c2-ear</artifactId>
>     <packaging>ear</packaging>
>     <parent>
>         <groupId>org.delta.esp.dap</groupId>
>         <artifactId>c2</artifactId>
>         <version>1.0.0.0</version>
>     </parent>
> 
> 
> Now many of these modules I want to build independently from one another
> such as a grouping of org.delta.esp.dap.c2
> When I do this, I can't use ${project.version} for the entries.
> 
> So what can I do as a best practice instead of doing a site-wide search
> and
> replace to go from:
>         <version>1.0.0.0</version>
> 
> to
> 
>         <version>1.0.0.1</version>
> 
> Each time I want to increment the build number?
> 
> 
> 
> -- 
> 
> Thanks,
> Mick Knutson
> 
> http://www.baselogic.com
> http://www.blincmagazine.com
> http://www.djmick.com
> http://www.myspace.com/mickknutson
> http://www.myspace.com/djmick_dot_com
> http://www.myspace.com/sexybeotches
> http://www.thumpradio.com
> ---
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-m2--project.version-in-multiple-modules-tf4163642s177.html#a12089125
Sent from the Maven - Users mailing list archive at Nabble.com.


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

Reply via email to