This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
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 Building Microservices this week in the Design 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: 18

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

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: 32507
    
214

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


[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17039
    
  26

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.


An IDE is no substitute for an Intelligent Developer.
Adrian Cordoba
Greenhorn

Joined: Jul 09, 2011
Posts: 18

Thank you, for your comments.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Maven: last version dependencies
 
jQuery in Action, 3rd edition