Joomla Extensions Demo

Support

Do not submit a bug report if you need technical support or have questions.

Forums

Post your suggestions ask for help in the community forums

Wiki

Visit the Wiki extensive and up to date documentation at your fingertips.

Contact Me

Missing images/links, any comments, suggestions, need help? Contact me

Skype

Need desperately help?
Skype Me™! But dont abuse of it!

Keep your software stack up to date with the Apache Maven Versions Plugin

User Rating:  / 0
PoorBest 
apache_maven

It is not unusual in a project to have a huge number of third party artifacts and Plug-in. Apache Maven help you keep track of them, along with their transitive dependencies.

But how do you know when a new version of an artifact is available?  This is where the Maven Versions plug-in come hand in.

The Versions Plug-in is used when you want to manage the versions of artifacts in a project's POM.

By running

mvn versions:display-dependency-updates

in any Apache Maven project or modules, you’ll get for example (we have a lot of 25 Maven modules, here is only one presented as an example, the list being too long)

[INFO] --------------------------------------------------------------------------------------------------
[INFO] Building Unnamed - com.innoveo:skye-services-api:jar:2.2.0-M-06
[INFO] --------------------------------------------------------------------------------------------------
[INFO]
[INFO] The following dependencies in Dependency Management have newer versions:
[INFO]   junit:junit ............................................. 4.4 -> 4.8.1
[INFO]   log4j:log4j ......................................... 1.2.15 -> 1.2.16
[INFO]   org.springframework:spring ...................... 2.5.6 -> 2.5.6.SEC02
[INFO]   org.springframework:spring-test ............... 2.5.6 -> 3.0.4.RELEASE

Attention:

It is not always an easy task to update some core components or 3rd party libraries in a complex software, as it may introduce some regressions, incompatibilities..

At least thanks to this Versions plug in, you are aware that they may be something newer to try. What this plug in do not report is why you may want to update some artifacts libraries:

  • Do I have to use the latest version x.y.z because of  security issues?
  • Will i get more performances by updating to x.y.z?
  • New Version x.y.z resolve bug xxxx, will I have other annoying issues?

In all the above case, you are on your own, but this is not the scope of this plug in. You’ll have anyway to

  1. Carefully decide which library can be updated,
  2. Match it to your software roadmap,
  3. Have enough confidence in your test suite (unit test, BDD, integration tests) and testing team,
  4. Communicate with your customer (for security issues in 3rd party library)
  5. .. and the list goes on

The Versions Plug-in has a lot of interesting goals.

Some are also updating values across all pom.xml for you.

  • versions:update-parent updates the parent section of a project so that it references the newest available version. For example, if you use a corporate root POM, this goal can be helpful if you need to ensure you are using the latest version of the corporate root POM.
  • versions:update-properties updates properties defined in a project so that they correspond to the latest available version of specific dependencies. This can be useful if a suite of dependencies must all be locked to one version.
  • versions:update-child-modules updates the parent section of the child modules of a project so the version matches the version of the current project. For example, if you have an aggregator pom that is also the parent for the projects that it aggregates and the children and parent versions get out of sync, this mojo can help fix the versions of the child modules. (Note you may need to invoke Maven with the -N option in order to run this goal if your project is broken so badly that it cannot build because of the version mis-match).
  • versions:lock-snapshots searches the pom for all -SNAPSHOT versions and replaces them with the current timestamp version of that -SNAPSHOT, e.g. -20090327.172306-4
  • versions:unlock-snapshots searches the pom for all timestamp locked snapshot versions and replaces them with -SNAPSHOT.
  • versions:resolve-ranges finds dependencies using version ranges and resolves the range to the specific version being used.
  • versions:set can be used to set the project version from the command line.
  • versions:use-releases searches the pom for all -SNAPSHOT versions which have been released and replaces them with the corresponding release version.
  • versions:use-next-releases searches the pom for all non-SNAPSHOT versions which have been a newer release and replaces them with the next release version.
  • versions:use-latest-releases searches the pom for all non-SNAPSHOT versions which have been a newer release and replaces them with the latest release version.
  • versions:use-next-snapshots searches the pom for all non-SNAPSHOT versions which have been a newer -SNAPSHOT version and replaces them with the next -SNAPSHOT version.
  • versions:use-latest-snapshots searches the pom for all non-SNAPSHOT versions which have been a newer -SNAPSHOT version and replaces them with the latest -SNAPSHOT version.
  • versions:use-next-versions searches the pom for all versions which have been a newer version and replaces them with the next version.
  • versions:use-latest-versions searches the pom for all versions which have been a newer version and replaces them with the latest version.
  • versions:commit removes the pom.xml.versionsBackup files. Forms one half of the built-in "Poor Man's SCM".
  • versions:revert restores the pom.xml files from the pom.xml.versionsBackup files. Forms one half of the built-in "Poor Man's SCM".

The easiest way to live dangerously is to try to update all 3rd parties in one shot by issuing

mvn versions:use-latest-versions

but that’s another story :-)

You might also like:
Apache Maven copy local file to a remote server server using
40 days ago
Apache Maven copy local file to a remote server server using
I will show you in an Apache Maven configuration file how to copy files to server each time the pa
Apache M2Eclipse: Get rid of Duplicate resources when openin
46 days ago
Apache M2Eclipse: Get rid of Duplicate resources when openin
In this small post, I’ll show you how to remove duplicated resources in the Open Resource view o
Apache Maven 3 Cookbook
188 days ago
Apache Maven 3 Cookbook
  First a big thanks to Packt Publishing for having sent me this book to review! I did enj
Apache Maven 3 Cookbook Review
234 days ago
Apache Maven 3 Cookbook Review
Thanks to Packt Publishing for having sent me this book to review. I will publish a review in the
List conflicting dependencies in the Maven reactor
350 days ago
List conflicting dependencies in the Maven reactor
The Maven Dependency Plugin among other things include a dependency:analyze-duplicate The depe
Break Maven build when there is a dependency conflict
350 days ago
Break Maven build when there is a dependency conflict
Scenarios You want to control Maven during dependency resolution and break the build i
OSGi-Bundle with the Maven-Bundle-Plugin
351 days ago
OSGi-Bundle with the Maven-Bundle-Plugin
OSGi (Open Service Gateway Initiative) is a Java framework for developing and deploying modu
Apache Maven Cargo deploy with Tomcat 7
361 days ago
Apache Maven Cargo deploy with Tomcat 7
Following the post about Deploy to Tomcat 6 using Maven, here is a ready to use example with the
blog comments powered by Disqus
Parent Category: Framework
Category: Apache Maven

Donations

Thank You for supporting my work
Subscribe to me on YouTube

Latest Articles

  • In this series of post I will outline some common techniques to help Joomla extensions development. As you know Jooml... ...
  • CedTag  has been updated to version 2.5.3 and correct a lot of bugs and contains some nice features. CedTag is t... ...
  • CedThumbnails has been updated to version 2.5.5 and contains 1 new features for both Joomla 1.7 and Joomla 2.5. For ex... ...
  • CedSmugmug  has been updated to version 2.5.2 and correct some bugs and contains some nice features. CedSmugmug&... ...
  • If you want an extra gigabyte of storage on your Dropbox account, the online cloud service invites you to compete in i... ...

Subscribe

Latest Comments

Popular Posts

rockettheme advertisement

dropbox logo

Help Us & Leave Feedback!

  • Do you have an excellent article idea you would like to read about here? Share it!
  • Do you have some interesting tips how we could improve our site?
  • Something missing here? Help us make this blog a better place, leave feedback!
We would love to hear from you! Be active! Write us now!