• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Force latest dependencies and plugins

 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have, just recently, started with Maven. Watched a couple of tutorials and read a book on it. I have one question and would greatly appreciate your response.

On the latest Maven, 3.2.5, I created a project using the "mvn archetype:generate" command and archetype="maven-archetype-quickstart". It created the project, however, by default, it adds version 3.8.1 of junit while the latest release version of 4.12 is available in the central repository. Similarly, it seems to pick up older versions of other dependencies and plug-ins that it adds, by default. I noticed, e.g., from the Effective POM that it picks up older versions of even "maven-compiler-plugin".

Though, I can, manually, edit the POM file to change the versions of plugins and dependencies, however, for every new project, Maven seem to go back to older versions.

1) What do I need to do in order to ask Maven to always pick up the latest release versions of all the dependencies and plugins from the central/local repository?

2) The second part of this question, I guess, is-Suppose, if I have an existing Maven project that has been there for some time now. Now, I wish to upgrade the dependencies/plug-ins to the latest versions for testing purposes before releasing a new version of this project. Given, that maven maintains the dependencies/plugins and their versions, is there an easy way to ask Maven to upgrade the project to the latest release versions of all the dependencies/plugins?

Thanks very much.

PS: I have Java 8 JDK and JRE installed on this machine.
 
author & internet detective
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Manish,
You can set <version>RELEASE</version> to pull the latest release. However you should change it a real version before you create a version of your software so it is a reproduceable build.
 
Manish Verma
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jeanne,

Cheers for the reply. That could help but I won't know what versions of the dependencies/plugins the team has been been developing against, unless it updates the POM to reflect the latest version number too?

If you allow me to rephrase, I was hoping that there would be an option to click on a button that would update the POM+Effective POM to the latest release versions of all the dependencies/plugins available in the central repository. I was trying to avoid everybody manually updating all the projects that they are working on to the latest dependencies/plugins, manually. A bit like Windows Update:- I can click on Windows Update option and it will look at my Windows libraries/Exes/components and connect to Microsoft website to check if there are any updates. If yes, then it tells me of them and allows to upgrade my Windows to the latest updates.

Could save a lot of duplicated time and rules out manual error in a repetitive task across teams/projects.

 
Jeanne Boyarsky
author & internet detective
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh! Take a look at the versions plugin. It does a lot (or all) of what you are asking for. I haven't used it, but it looks promising to meet your need.
 
Manish Verma
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jeanne,

You are a rock star!! Thank you very much. I tried so hard to find an answer for this one. Merci!
 
reply
    Bookmark Topic Watch Topic
  • New Topic