I don't know if I'm missing something, but I have a problem with the Codehaus versions plugin for Maven. Here's a simplification of my situation:
- root:
- moduleA
- moduleB
'root' is an aggregator POM, i.e. declaring moduleA and moduleB as child modules, and A and B both have root as parent.
Both A and B have a dependency on project-C, but the version of this dependency is defined in a property - say <project-C.version>
- not hardcoded. This property is defined in root, so both A and B inherit the same version value for project-C.
In root POM:
<properties>
<project-C.version>1.0</project-C.version>
In module A and B (remember root is parent):
<dependency>
<groupId>com.blah</groupId>
<artifactId>project-C</artifactId>
<version>${project-C.version}</version>
</dependency>
Now, say newer version 1.1-SNAPSHOT of project-C becomes available. I want to use the versions plugin to show this to me, so I run:
$ cd /projects/root
$ mvn versions:display-property-updates -DallowSnapshots=true
but all I get is something like this:
[INFO] Building root [INFO] This project does not have any properties associated with versions [INFO] Building moduleA [INFO] This project does not have any properties associated with versions [INFO] Building moduleB [INFO] This project does not have any properties associated with versions
It doesn't make a difference if I run it on root, moduleA or moduleB: it always says that. Of course it works if I hardcode project-C's version number in the dependencies.
So, in summary: I want to centralise dependency versions as properties in a root (aggregator/parent) POM, and I want the versions plugin to pick those up for goals that work on properties, i.e.:
- display-property-updates
- update-properties
How do I do this? Am I missing something? Is this a bug in versions plugin?