Red Hat Bugzilla – Bug 851934
org.clojure:clojure:1.4.0 dependency incorrectly resolves to clojure-compat.jar
Last modified: 2014-07-24 23:19:24 EDT
When using mvn-local to build a project that depends on Clojure 1.4, and the clojure-compat package is installed on the system, the dependency for Clojure incorrectly resolves to /usr/share/java/clojure-compat.jar instead of /usr/share/java/clojure.jar.
The reason this happens is because the clojure-compat JPP maven-fragment is identifying itself as org.clojure:clojure:1.2.1. Here are the contents of /usr/share/maven-fragments/clojure-compat:
Unless there is some reason this is done, the artifactId used in the clojure-compat fragment should be changed to clojure-compat. This can be corrected by changing the artifactId variable at the top of the clojure-compat.spec to clojure-compat.
%global artifactId clojure-compat
Version-Release number of selected component:
This problem can be observed in f17, f18 and rawhide (probably f16 too).
If the clojure-compat package is installed on the system, anytime a Maven project with the dependency org.clojure:clojure:1.4.0 is built using mvn-local, /usr/share/java/clojure-compat.jar will be used on the classpath instead of /usr/share/java/clojure.jar.
If the clojure-compat package is removed from the system, then the correct jar, /usr/share/java/clojure.jar, is used.
To observe this problem, first create an empty Maven project. Substitute the contents of the pom.xml as follows:
<?xml version="1.0" encoding="UTF-8"?>
Now run a compile using mvn-local in verbose/debug mode and redirect the output to a file:
mvn-local compile -X -Dmaven.local.debug > output.log 2>&1
In the output, you'll see the following indicators of the resolution problem:
[DEBUG] Classpath: [/home/dallen/.../BZ851934/target/classes
I think this bug may actually identify a more general problem, which is that if there are two JPP maven fragments that identify as the same groupId:artifactId, but different versions, then the request for the artifact with the newer version is not being honored.
If the dependency in the pom.xml were to be changed to org.clojure:clojure:1.2.1, then I would expect that to resolve to /usr/share/java/clojure-compat.jar. Because the request is for org.clojure:clojure:1.4.0, and there is a maven fragment which has that exact match, I would expect it to resolve to the appropriate artifact, /usr/share/java/clojure.jar.
I think this general problem needs to be solved.
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora
'version' of '17'.
Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version prior to Fedora 17's end of life.
Bug Reporter: Thank you for reporting this issue and we are sorry that
we may not be able to fix it before Fedora 17 is end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora, you are encouraged change the
'version' to a later Fedora version prior to Fedora 17's end of life.
Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
Fedora 17 changed to end-of-life (EOL) status on 2013-07-30. Fedora 17 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.
If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version.
Thank you for reporting this bug and we are sorry it could not be fixed.