aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Maven project's Version Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Maven project Watch "Maven project New topic
Author

Maven project's Version

junchen liu
Greenhorn

Joined: Feb 19, 2008
Posts: 26
Hello!

at moment we put project version like this:

<modelVersion>4.0.0</modelVersion>
<groupId>xxx</groupId>
<artifactId>myProject</artifactId>
<packaging>jar</packaging>
<version>5.0.1</version>
<name>projectxxx</name>

and this number changes after each release(6.1 7.1 etc....)

problem is other projects referencing it as a dependency

need to change the version number 2.


with 30 different projects, this kind of work is tedious.


is there anyway, I can tell maven to build my project based on whatever is

in the CVS head, without referencing its version number?


many thanks!

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16014
    
  20

Actually, one of the points behind Maven is that it provides a guaranteed product out of the buiild. So properly, each of those 30 projects should be tested and certified as functioning properly with the new product before updating the POM permanently. And that's a lot more work than just the simple text edit.

Obviously this doesn't work very well for new project development where all modules are in flux and there's not yet a production environment to screw up. For that, you can set up the POM dependency to use the latest version in the repository.

Another option is to do what I do for systems like Spring where there are a whole lot of dependencies for the different optional components where I want them all of the same version. For that, I use a variable substitution in the dependency version info.


Customer surveys are for companies who didn't pay proper attention to begin with.
junchen liu
Greenhorn

Joined: Feb 19, 2008
Posts: 26
Tim Holloway wrote:

Agreed !
Actually, one of the points behind Maven is that it provides a guaranteed product out of the buiild. So properly, each of those 30 projects should be tested and certified as functioning properly with the new product before updating the POM permanently. And that's a lot more work than just the simple text edit.

The is my case ! but how?
Obviously this doesn't work very well for new project development where all modules are in flux and there's not yet a production environment to screw up. For that, you can set up the POM dependency to use the latest version in the repository.

A interesting option, most elegant one I would say, but how?
Another option is to do what I do for systems like Spring where there are a whole lot of dependencies for the different optional components where I want them all of the same version. For that, I use a variable substitution in the dependency version info.


many thanks!
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

RTFM: http://www.sonatype.com/books/mvnref-book/reference/pom-relationships-sect-version-ranges.html


JBoss In Action
Joachim Rohde
Ranch Hand

Joined: Nov 27, 2006
Posts: 423

Tim Holloway wrote:Actually, one of the points behind Maven is that it provides a guaranteed product out of the buiild.

But that is only true if you but the version number in square brackets. Else it's only a suggestion and Maven may pick also another version of your dependendy if necessary! (See also the link that Peter posted).
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16014
    
  20

Joachim Rohde wrote:
Tim Holloway wrote:Actually, one of the points behind Maven is that it provides a guaranteed product out of the buiild.

But that is only true if you but the version number in square brackets. Else it's only a suggestion and Maven may pick also another version of your dependendy if necessary! (See also the link that Peter posted).


Well, that was educational. I really hadn't explored all the nuances, although I do periodically have to weed through projects that have transitive requirement that conflict.

An explicit version number may only be a suggestion, but it's a very powerful suggestion, The Maven version resolution mechanism is going to try very hard to appease it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Maven project's Version