Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Maven: last version dependencies

 
Adrian Cordoba
Greenhorn
Posts: 26
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
Adrian Cordoba
Greenhorn
Posts: 26
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34973
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another option is to use the keyword RELEASE. This means the latest available release. Your approach is better though as it sets constraints.
 
Tim Holloway
Saloon Keeper
Posts: 18303
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Adrian Cordoba
Greenhorn
Posts: 26
Java Linux Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, for your comments.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic