Wrong calculation of transient dependecies if artifact is referenced from
different scopes
------------------------------------------------------------------------------------------
Key: MNG-1571
URL: http://jira.codehaus.org/browse/MNG-1571
Project: Maven 2
Type: Bug
Components: maven-core
Reporter: Joerg Schaible
I have an artifact A (elsag-test below), that is used by other projects only
for the tests. A has a dependency to commons-logging. Artifact B has a
compile-time dependency to an artifact, that also has a dependency on
commons-logging. Nevertheless, the resulting scope for commons-logging is
wrongly calculated as test and the compilation fails.
============= %< ================
[DEBUG] Retrieving parent-POM from the repository for project:
com.elsagsolutions.commons:super-project:pom:1.1-SNAPSHOT
[DEBUG] meta: using locally installed snapshot
[DEBUG] com.elsagsolutions.commons:elsag-test:jar:1.2-SNAPSHOT (selected for
test)
[DEBUG] cglib:cglib-nodep:jar:2.1_3 (selected for test)
[DEBUG] commons-logging:commons-logging:jar:1.0.4 (selected for test)
[DEBUG] jmock:jmock-cglib:jar:1.0.1 (selected for test)
[DEBUG] jmock:jmock:jar:1.0.1 (selected for test)
[DEBUG] junit:junit:jar:3.8.1 (selected for test)
[DEBUG] commons-httpclient:commons-httpclient:jar:2.0.2 (selected for compile)
[DEBUG] commons-logging:commons-logging:jar:1.0.4 (setting scope to:
compile)
[DEBUG] commons-logging:commons-logging:jar:1.0.3 (removed - nearer found:
1.0.4)
[DEBUG] commons-logging:commons-logging:jar:1.0.3 (selected for compile)
[DEBUG] commons-io:commons-io:jar:1.0 (selected for compile)
[DEBUG] junit:junit:jar:3.8.1 (selected for compile)
============= %< ================
[INFO]
----------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO]
----------------------------------------------------------------------------
[INFO] Compilation failure
C:\Work\Projects\commons\lang\src\java\com\elsagsolutions\lang\net\AbstractSocketStreamServer.java:[14,34]
package org.apache.commons.logging does not exist
============= %< ================
If I add commons-logging as direct dependency of B it works:
============= %< ================
[DEBUG] Retrieving parent-POM from the repository for project:
com.elsagsolutions.commons:super-project:pom:1.1-SNAPSHOT
[DEBUG] meta: using locally installed snapshot
[DEBUG] com.elsagsolutions.commons:elsag-test:jar:1.2-SNAPSHOT (selected for
test)
[DEBUG] cglib:cglib-nodep:jar:2.1_3 (selected for test)
[DEBUG] commons-logging:commons-logging:jar:1.0.4 (selected for test)
[DEBUG] jmock:jmock-cglib:jar:1.0.1 (selected for test)
[DEBUG] jmock:jmock:jar:1.0.1 (selected for test)
[DEBUG] junit:junit:jar:3.8.1 (selected for test)
[DEBUG] commons-logging:commons-logging:jar:1.0.4 (selected for compile)
[DEBUG] commons-httpclient:commons-httpclient:jar:2.0.2 (selected for compile)
[DEBUG] commons-logging:commons-logging:jar:1.0.3 (removed - nearer found:
1.0.4)
[DEBUG] commons-logging:commons-logging:jar:1.0.3 (selected for compile)
============= %< ================
Unfortunately this introduces a dependency for commons-logging, therefore I
wanted to set the dep at least optional, but then commons-logging is again not
available at compile time. Might be related to MNG-1378.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]