I'm building a project using maven-local.
My pom file has dependency to hamcrest-core and hamcrest-library
My spec file has
In my local box (f17) it resolved correctly. But when I try to build
it in mock targeting rawhide, it always resolve to hamcrest (which
is 1.1 and fail to compile)
I've tried to add a depmap with -Dmaven.local.depmap.file as below,
still no luck. Any one know why is that and how can I force it to
reference hamcrest12 package? Thanks.
There are 2 reasons for that.
1. Your POM specifies version 1.2.1 of hamcrest, but in Fedora hamcrest12 has
version 1.2. Quote from Java packaging guidelines: "Maven will [...] return
versioned jar if it matches the version asked for in the pom file." In your
case these versions don't match. You need to patch your POM file to point to
the exact version available in the system if you want to use compatibility
package, otherwise default system version vill be used.
2. There is a bug in hamcrest12 package. It doesn't follow packaging guidelines
of compatibility packages. Quoting the guidelines: "Jar and pom files MUST be
versioned". In case of hamcrest12 they are not:
$ rpm -ql hamcrest12
You should report this bug against hamcrest12 package.