Wednesday, July 27, 2011

RHQ tip of the day: plugin version

I recently had the issue while working on the AS7 plugin that no matter what version I was using in the maven pom, the server always printed a message like the following on deployment:

22:09:51,082 INFO  [ProductPluginDeployer] Newer version of [jboss-as-7] plugin 
found (version 4.0.0-SNAPSHOT) - older version (4.0.0-SNAPSHOT ....

And this happened with a pom version of 4.1.0-SNAPSHOT. The manifest file also showed 4.1* and the file name also had 4.1.0* in it and not 4.0.0.

It turned out that I had an explicit entry like this in the plugin descriptor, rhq-plugin.xml:

<plugin name="jboss-as-7"        
        version="4.0.0-SNAPSHOT" >

This explicit version overwrites all the other version qualifiers that maven creates; and a maven release cycle will not update it as well. After removing the version attribute from the plugin element, versioning was as expected.

So if you need a stable version, encode it in the plugin descriptor. Otherwise leave it to the build magic to provide the version.


No comments: