Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Ant, Maven and Other Build Tools and the fly likes Maven: last version dependencies 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: last version dependencies" Watch "Maven: last version dependencies" New topic
Author

Maven: last version dependencies

Adrian Cordoba
Greenhorn

Joined: Jul 09, 2011
Posts: 15

Hi, all!
I'm newbie in Maven.
How can I make in Maven's POM for my project depends on an artifact's last version?

If I declare:

For this section, I understand JUnit version 3.8 is included in my dependencies. But I want, the last version of JUnit be included.


[Adrián E. Córdoba]
Adrian Cordoba
Greenhorn

Joined: Jul 09, 2011
Posts: 15

I got it!
For depend on artifact's last version, use "[version,]", as in the example:

In this way, the project depends on JUnit last version, 3.8 or higher.

Thank you, anyway.
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30957
    
158

Another option is to use the keyword RELEASE. This means the latest available release. Your approach is better though as it sets constraints.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16250
    
  21

There is a price to be paid for such flexibility, however.

In its "normal" mode of working with explicit version numbers, Maven guarantees a consistent result, no matter how long the project has been sitting on the shelf or what versions of modules another person's repository chain includes.

It also guarantees that all of the dependencies have been verified to play well with each other, which can be very important with large and complex projects, where obscure interactions can - and frequently do - cause builds and/or runs to fail. Maven's version of "DLL Hell", if you like.

In other words, with vast power comes vast responsibility, so use this ability with due care.


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

Joined: Jul 09, 2011
Posts: 15

Thank you, for your comments.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Maven: last version dependencies