When an artifact exists in both the m2 cache, and on the system, mvn-rpmbuild does not use the version in the m2 cache. Resources : http://rgrunber.fedorapeople.org/abc-1.0-1.fc19.noarch.rpm (rpm providing abc:abc) http://rgrunber.fedorapeople.org/abc.tar.bz2 (project abc:abc) Steps to reproduce : 1. yum install abc-1.0.fc19.noarch.rpm. So now there is abc:abc:1.0 on the system. 2. Extract abc.tar.bz2 and run mvn-rpmbuild clean install. Now there should be abc:abc:1.0 in the m2 cache from where the build was run. 3. Change project version to 1.1 in pom.xml and uncomment dependency on abc:abc:1.0. 4. Run mvn-rpmbuild -X -Dmaven.local.debug=true clean install 1>log1.txt 2>log2.txt The logs (classpathElements list) should reveal that when abc:abc:1.0 was requested, abc:abc:1.0 was returned from the system repository (/usr/share/maven/repository/JPP/abc.jar), and not the local m2 cache. Additionally, you can yum remove abc, and run the build again to confirm that the classpathElements list changes to use the artifact in the m2 cache (/path/to/build/.m2/abc/abc/1.0/abc-1.0.jar). Have I done something weird ? It would be nice if there were a way (even if it weren't the default) to have the resolver check the m2 cache first.
There is a workaround available. Assuming you gave artifact FOO:BAR:VER stored in .m2 cache, you can force maven to resolve it by using this custom depmap: <dependency> <maven> <groupId>FOO</groupId> <artifactId>BAR</artifactId> <version>VER</version> </maven> <jpp> <groupId>../../../..</groupId> <artifactId>$(PWD)/.m2/FOO/BAR/VER</artifactId> <version>VER</version> </jpp> </dependency>
There's a fix for this in rawhide (http://pkgs.fedoraproject.org/cgit/maven.git/commit/?id=9b93db7e101a6f191a5a63f468de1000204e15e9), and I've confirmed I can build Tycho with it. Artifacts seem to be resolving first from the reactor cache. The workaround seemed pretty neat but didn't work in the case of resolving poms. This is mainly because when looking up the pom path, the groupId's '/' are replaced with '.' which breaks the path. I guess if anyone ever wanted to get this working locally, they could create symlinks to the root in %{_mavenpomdir} as 'foo-' and one in %{_datadir}/maven/repository as 'foo'. From there the gid could be set to 'foo' and the aid could be the path to the pom/jar with the extension omitted.
maven-3.0.4-14.fc17 has been submitted as an update for Fedora 17. https://admin.fedoraproject.org/updates/maven-3.0.4-14.fc17
maven-3.0.4-14.fc18 has been submitted as an update for Fedora 18. https://admin.fedoraproject.org/updates/maven-3.0.4-14.fc18
Package maven-3.0.4-14.fc18: * should fix your issue, * was pushed to the Fedora 18 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing maven-3.0.4-14.fc18' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2012-16797/maven-3.0.4-14.fc18 then log in and leave karma (feedback).
maven-3.0.4-21.fc18 has been submitted as an update for Fedora 18. https://admin.fedoraproject.org/updates/maven-3.0.4-21.fc18
maven-3.0.4-21.fc18 has been pushed to the Fedora 18 stable repository. If problems still persist, please make note of it in this bug report.