You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by "John Fallows (JIRA)" <ji...@codehaus.org> on 2005/09/28 20:05:13 UTC

[jira] Created: (MNG-1041) Classifier-specific dependencies colliding with generic dependencies

Classifier-specific dependencies colliding with generic dependencies
--------------------------------------------------------------------

         Key: MNG-1041
         URL: http://jira.codehaus.org/browse/MNG-1041
     Project: Maven 2
        Type: Bug
    Versions: 2.0-beta-1    
 Environment: Win XP SP2, Java 1.4.2
 Reporter: John Fallows


It seems like there is a collision between dependencies from the same
project but with different classifiers, causing only the main
dependency artifact to be present on the compilation classpath.

project/
 api-module/
 impl-module/

The api-module generates 2 artifacts, one with classifier "mock".
The impl-module depends on both of these artifiacts, one with "mock"
classifier at "test" scope and the other with no classifier at the
default "compile" scope.

During compilation of the impl-module tests, classes from the
api-module "mock" artifact are not found on the classpath.

It seems as though the "mock" artifact and the regular artifact are
colliding, causing the "mock" artifact to be removed from the test
compilation classpath.

Both the "mock" and regular artifacts from the api-module have type
"jar".  Even when the "mock" type is changed to "zip", the same
problem occurs.

Perhaps dependency classifiers are ignored while constructing the
compilation classpath?

Brett Porter wrote:
I think its because the project you are depending on is in the
reactor, and its probably a bug.

Basically, its trying to use the built version of that project, but
projects are only identified by group:artifactId


-- 
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: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Commented: (MNG-1041) Classifier-specific dependencies colliding with generic dependencies

Posted by "Bob Allison (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-1041?page=comments#action_47677 ] 

Bob Allison commented on MNG-1041:
----------------------------------

I don't think I can use this for my mocks, and here's why:

I have proj-a and proj-b, both of which have unit tests in src/test.  Proj-b uses the jar produced by proj-a.  For unit tests of proj-b I need the mock objects of proj-a but I don't want to inherit the unit tests of proj-a (no need to run them as part of proj-b since they test proj-a).  I also do not want the mock objects for proj-a to pollute the classpath during the unit tests of proj-a, since I have some factory classes which exist in the mock objects to allow the proj-b unit tests to create the mock object of the proj-a class and load it into the replacement factory during its tests.

To accomplish what I need, I need to have a src/mock directory that is built and deployed as a jar separate from the test classes.  I don't know if that can be done by making a "mock-jar" goal for the jar plugin or if something else needs to be done.

> Classifier-specific dependencies colliding with generic dependencies
> --------------------------------------------------------------------
>
>          Key: MNG-1041
>          URL: http://jira.codehaus.org/browse/MNG-1041
>      Project: Maven 2
>         Type: Bug
>     Versions: 2.0-beta-1
>  Environment: Win XP SP2, Java 1.4.2
>     Reporter: John Fallows
>     Assignee: Brett Porter
>      Fix For: 2.0-beta-3

>
>
> It seems like there is a collision between dependencies from the same
> project but with different classifiers, causing only the main
> dependency artifact to be present on the compilation classpath.
> project/
>  api-module/
>  impl-module/
> The api-module generates 2 artifacts, one with classifier "mock".
> The impl-module depends on both of these artifiacts, one with "mock"
> classifier at "test" scope and the other with no classifier at the
> default "compile" scope.
> During compilation of the impl-module tests, classes from the
> api-module "mock" artifact are not found on the classpath.
> It seems as though the "mock" artifact and the regular artifact are
> colliding, causing the "mock" artifact to be removed from the test
> compilation classpath.
> Both the "mock" and regular artifacts from the api-module have type
> "jar".  Even when the "mock" type is changed to "zip", the same
> problem occurs.
> Perhaps dependency classifiers are ignored while constructing the
> compilation classpath?
> Brett Porter wrote:
> I think its because the project you are depending on is in the
> reactor, and its probably a bug.
> Basically, its trying to use the built version of that project, but
> projects are only identified by group:artifactId

-- 
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: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Updated: (MNG-1041) Classifier-specific dependencies colliding with generic dependencies

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-1041?page=all ]

Brett Porter updated MNG-1041:
------------------------------

    Fix Version: 2.0-beta-3

> Classifier-specific dependencies colliding with generic dependencies
> --------------------------------------------------------------------
>
>          Key: MNG-1041
>          URL: http://jira.codehaus.org/browse/MNG-1041
>      Project: Maven 2
>         Type: Bug
>     Versions: 2.0-beta-1
>  Environment: Win XP SP2, Java 1.4.2
>     Reporter: John Fallows
>      Fix For: 2.0-beta-3

>
>
> It seems like there is a collision between dependencies from the same
> project but with different classifiers, causing only the main
> dependency artifact to be present on the compilation classpath.
> project/
>  api-module/
>  impl-module/
> The api-module generates 2 artifacts, one with classifier "mock".
> The impl-module depends on both of these artifiacts, one with "mock"
> classifier at "test" scope and the other with no classifier at the
> default "compile" scope.
> During compilation of the impl-module tests, classes from the
> api-module "mock" artifact are not found on the classpath.
> It seems as though the "mock" artifact and the regular artifact are
> colliding, causing the "mock" artifact to be removed from the test
> compilation classpath.
> Both the "mock" and regular artifacts from the api-module have type
> "jar".  Even when the "mock" type is changed to "zip", the same
> problem occurs.
> Perhaps dependency classifiers are ignored while constructing the
> compilation classpath?
> Brett Porter wrote:
> I think its because the project you are depending on is in the
> reactor, and its probably a bug.
> Basically, its trying to use the built version of that project, but
> projects are only identified by group:artifactId

-- 
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: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Commented: (MNG-1041) Classifier-specific dependencies colliding with generic dependencies

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-1041?page=comments#action_47678 ] 

Brett Porter commented on MNG-1041:
-----------------------------------

yes, you'll need to write a custom plugin, or figure out a way to separate the projects to that extent.

If you write a plugin to produce a -mocks jar, this will work for you.


> Classifier-specific dependencies colliding with generic dependencies
> --------------------------------------------------------------------
>
>          Key: MNG-1041
>          URL: http://jira.codehaus.org/browse/MNG-1041
>      Project: Maven 2
>         Type: Bug
>     Versions: 2.0-beta-1
>  Environment: Win XP SP2, Java 1.4.2
>     Reporter: John Fallows
>     Assignee: Brett Porter
>      Fix For: 2.0-beta-3

>
>
> It seems like there is a collision between dependencies from the same
> project but with different classifiers, causing only the main
> dependency artifact to be present on the compilation classpath.
> project/
>  api-module/
>  impl-module/
> The api-module generates 2 artifacts, one with classifier "mock".
> The impl-module depends on both of these artifiacts, one with "mock"
> classifier at "test" scope and the other with no classifier at the
> default "compile" scope.
> During compilation of the impl-module tests, classes from the
> api-module "mock" artifact are not found on the classpath.
> It seems as though the "mock" artifact and the regular artifact are
> colliding, causing the "mock" artifact to be removed from the test
> compilation classpath.
> Both the "mock" and regular artifacts from the api-module have type
> "jar".  Even when the "mock" type is changed to "zip", the same
> problem occurs.
> Perhaps dependency classifiers are ignored while constructing the
> compilation classpath?
> Brett Porter wrote:
> I think its because the project you are depending on is in the
> reactor, and its probably a bug.
> Basically, its trying to use the built version of that project, but
> projects are only identified by group:artifactId

-- 
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: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Closed: (MNG-1041) Classifier-specific dependencies colliding with generic dependencies

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-1041?page=all ]
     
Brett Porter closed MNG-1041:
-----------------------------

    Resolution: Fixed

I think you can also now use MNG-932 for your mocks

> Classifier-specific dependencies colliding with generic dependencies
> --------------------------------------------------------------------
>
>          Key: MNG-1041
>          URL: http://jira.codehaus.org/browse/MNG-1041
>      Project: Maven 2
>         Type: Bug
>     Versions: 2.0-beta-1
>  Environment: Win XP SP2, Java 1.4.2
>     Reporter: John Fallows
>     Assignee: Brett Porter
>      Fix For: 2.0-beta-3

>
>
> It seems like there is a collision between dependencies from the same
> project but with different classifiers, causing only the main
> dependency artifact to be present on the compilation classpath.
> project/
>  api-module/
>  impl-module/
> The api-module generates 2 artifacts, one with classifier "mock".
> The impl-module depends on both of these artifiacts, one with "mock"
> classifier at "test" scope and the other with no classifier at the
> default "compile" scope.
> During compilation of the impl-module tests, classes from the
> api-module "mock" artifact are not found on the classpath.
> It seems as though the "mock" artifact and the regular artifact are
> colliding, causing the "mock" artifact to be removed from the test
> compilation classpath.
> Both the "mock" and regular artifacts from the api-module have type
> "jar".  Even when the "mock" type is changed to "zip", the same
> problem occurs.
> Perhaps dependency classifiers are ignored while constructing the
> compilation classpath?
> Brett Porter wrote:
> I think its because the project you are depending on is in the
> reactor, and its probably a bug.
> Basically, its trying to use the built version of that project, but
> projects are only identified by group:artifactId

-- 
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: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org