Bug 851934 - org.clojure:clojure:1.4.0 dependency incorrectly resolves to clojure-compat.jar
org.clojure:clojure:1.4.0 dependency incorrectly resolves to clojure-compat.jar
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: 0xFFFF (Show other bugs)
17
Unspecified Linux
unspecified Severity high
: ---
: ---
Assigned To: kushaldas@gmail.com
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-27 00:49 EDT by Dan Allen
Modified: 2014-07-24 23:19 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-07-31 22:35:05 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Dan Allen 2012-08-27 00:49:18 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:

<dependency>
    <maven>
        <groupId>org.clojure</groupId>
        <artifactId>clojure</artifactId>
        <version>1.2.1</version>
    </maven>
    <jpp>
        <groupId>JPP</groupId>
        <artifactId>clojure-compat</artifactId>
        <version>1.2.1</version>
    </jpp>
</dependency>

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).

clojure-1.4.0-2.fc17.noarch
clojure-compat-1.2.1-2.fc17.noarch

clojure-1.4.0-3.fc18.noarch
clojure-compat-1.2.1-2.fc18.noarch

How reproducible:

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.
Comment 1 Dan Allen 2012-08-27 00:56:36 EDT
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"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.redhat.bugzilla</groupId>
    <artifactId>BZ851934</artifactId>
    <version>1.0.0</version>
    <dependencies>
        <dependency>
            <groupId>org.clojure</groupId>
            <artifactId>clojure</artifactId>
            <version>1.4.0</version>
        </dependency>
    </dependencies>
</project>

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:

[...]
=============JAVADIRREADER-FIND_ARTIFACT: clojure
Wanted GROUPID=org.clojure
Wanted ARTIFACTID=clojure
Wanted VERSION=1.4.0
Resolved GROUPID=JPP
Resolved ARTIFACTID=clojure-compat
Resolved VERSION=1.2.1
Returning /usr/share/maven-poms/JPP-clojure-compat.pom
[DEBUG] com.redhat.bugzilla:BZ851934:jar:1.0.0
[DEBUG]    org.clojure:clojure:jar:1.4.0:compile
=============JAVADIRREADER-FIND_ARTIFACT: clojure
Wanted GROUPID=org.clojure
Wanted ARTIFACTID=clojure
Wanted VERSION=1.4.0
Resolved GROUPID=JPP
Resolved ARTIFACTID=clojure-compat
Resolved VERSION=1.2.1
Returning /usr/share/maven/repository/JPP/clojure-compat.jar
[...]
[DEBUG] Classpath: [/home/dallen/.../BZ851934/target/classes
 /usr/share/maven/repository/JPP/clojure-compat.jar]
[...]
Comment 2 Dan Allen 2012-08-27 01:02:52 EDT
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.
Comment 3 Fedora End Of Life 2013-07-03 19:40:17 EDT
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.
Comment 4 Fedora End Of Life 2013-07-31 22:35:09 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.