See CodehausJira:MNG-2653 (though root cause may be CodehausJira:MNG-2651).
From Ronald:
Version is not always inherited correctly (if not specified in the
pom, it sometimes gets a random version depending on what other
things are being loaded). We've worked around this mostly by
ensuring explicit versions everywhere, but it still rears its head
occasionally on external poms.
More details:
<project>
<modelVersion>4.0.0</modelVersion>
<artifactId>foo</artifactId>
<parent>
<groupId>group</groupId>
<artifactId>bar</artifactId>
<version>1.2.3</version>
</parent>
The current project is supposed to inherit the version from the
parent,
i.e. also have version 1.2.3. In some weird cases this doesn't happen
properly, and shows up with mvn trying to find/download some random
version of the artifact.
The first time this happened was before you joined - here's the
relevant part of the email I sent out then:
-------------------------------------------------------------------
Due to a bug in maven (I think), the build will fail with the
following
error:
[INFO] Failed to resolve artifact.
Missing:
----------
1) org.codehaus.cargo:cargo-core-api-container:jar:2.4.1
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=org.codehaus.cargo -
DartifactId=cargo-core-api-container \
-Dversion=2.4.1 -Dpackaging=jar -Dfile=/path/to/file
Path to dependency:
1) org.codehaus.cargo:cargo-maven2-plugin:maven-plugin:0.2
2) org.codehaus.cargo:cargo-core-container-resin:jar:0.8
3) org.codehaus.cargo:cargo-core-api-container:jar:2.4.1
----------
1 required artifact is missing.
To fix this, edit
~/.m2/repository/org/codehaus/cargo/cargo-core-containers/0.8/
cargo-core-containers-0.8.pom
and replace the "${version}" with "0.8". From then on the builds will
work fine. I'll probably submit a bug-report on this.
-------------------------------------------------------------------
If you look at the cargo-core-containers-0.8.pom you'll see the user
of ${version} in one of the dependencies, which should be the current
artifact's version, but got assigned the random version 2.4.1 above.
Note that this is a hard to reproduce bug: it only happened with
certain sets and versions of stuff in your local repository and in
your build (IIRC if you ran the build from somewhere other than head
it worked).