my dog learned polymorphism*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 13

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: 13

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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30130
    
150

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: 15960
    
  19

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: 13

Thank you, for your comments.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Maven: last version dependencies
 
Similar Threads
Spring AOP
Maven web project dependencies
Could not resolve dependencies for maven project
Problem in generating client code from wsdl using maven + axis2
Maven dependencies