You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Stephen Duncan Jr (JIRA)" <ji...@codehaus.org> on 2006/05/16 03:56:40 UTC

[jira] Created: (MECLIPSE-107) Dependency Version Incorrectly Taken from DependencyManagement

Dependency Version Incorrectly Taken from DependencyManagement
--------------------------------------------------------------

         Key: MECLIPSE-107
         URL: http://jira.codehaus.org/browse/MECLIPSE-107
     Project: Maven 2.x Eclipse Plugin
        Type: Bug

    Versions: 2.2    
    Reporter: Stephen Duncan Jr
    Priority: Critical
 Attachments: dmtest.zip

The version used when generating .classpath is taken from dependencyManagement even though the child pom sets the dependency version, which should override what is in dependencyManagement.  This is a regression from the correct behaviour in 2.1.

The attached project demonstrates the problem.  The .classpath file generated for the "child" project should specify log4j-1.2.13, but instead specifies 1.28.

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


[jira] Commented: (MECLIPSE-107) Dependency Version Incorrectly Taken from DependencyManagement

Posted by "Arnaud Heritier (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MECLIPSE-107?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_90253 ] 

Arnaud Heritier commented on MECLIPSE-107:
------------------------------------------

ok, thanks for your feedback. I'll add your test case in our tests and I'll fix it this WE.

> Dependency Version Incorrectly Taken from DependencyManagement
> --------------------------------------------------------------
>
>                 Key: MECLIPSE-107
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-107
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: dependency resolution
>    Affects Versions: 2.2
>            Reporter: Stephen Duncan Jr
>            Priority: Critical
>         Attachments: dmtest.zip, MECLIPSE-107-maven-eclipse-plugin-20061211-1200.patch
>
>
> The version used when generating .classpath is taken from dependencyManagement even though the child pom sets the dependency version, which should override what is in dependencyManagement.  This is a regression from the correct behaviour in 2.1.
> The attached project demonstrates the problem.  The .classpath file generated for the "child" project should specify log4j-1.2.13, but instead specifies 1.28.

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

        

[jira] Commented: (MECLIPSE-107) Dependency Version Incorrectly Taken from DependencyManagement

Posted by "Damien Lecan (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MECLIPSE-107?page=comments#action_80585 ] 
            
Damien Lecan commented on MECLIPSE-107:
---------------------------------------

I have looked at the code and this bad resolution comes from theses lines of code :

{code:title=AbstractIdeSupportMojo.java, rev474384|borderStyle=solid}
Map managedVersions = createManagedVersionMap( getArtifactFactory(), project.getId(),
              project.getDependencyManagement() );

...

artifactResolutionResult = artifactCollector.collect(
           getProjectArtifacts(), project.getArtifact(),
           managedVersions, localRepo, project.getRemoteArtifactRepositories(),
           getArtifactMetadataSource(), null, listeners );
{code}
The list of artifacts to add in .classpath is filtered by managed dependencies. I don't understand why managed dependency have to be taken into account to build .classpath ? This file may be build with just real dependencies ?

> Dependency Version Incorrectly Taken from DependencyManagement
> --------------------------------------------------------------
>
>                 Key: MECLIPSE-107
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-107
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: dependency resolution
>    Affects Versions: 2.2
>            Reporter: Stephen Duncan Jr
>            Priority: Critical
>         Attachments: dmtest.zip
>
>
> The version used when generating .classpath is taken from dependencyManagement even though the child pom sets the dependency version, which should override what is in dependencyManagement.  This is a regression from the correct behaviour in 2.1.
> The attached project demonstrates the problem.  The .classpath file generated for the "child" project should specify log4j-1.2.13, but instead specifies 1.28.

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

        

[jira] Closed: (MECLIPSE-107) Dependency Version Incorrectly Taken from DependencyManagement

Posted by "Arnaud Heritier (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MECLIPSE-107?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Arnaud Heritier closed MECLIPSE-107.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.5

I added your testcase in our build and now it's fixed (due to my recent changes about dependencies management)

> Dependency Version Incorrectly Taken from DependencyManagement
> --------------------------------------------------------------
>
>                 Key: MECLIPSE-107
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-107
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: Dependencies resolution
>    Affects Versions: 2.2
>            Reporter: Stephen Duncan Jr
>            Assignee: Arnaud Heritier
>            Priority: Critical
>             Fix For: 2.5
>
>         Attachments: dmtest.zip, MECLIPSE-107-maven-eclipse-plugin-20061211-1200.patch
>
>
> The version used when generating .classpath is taken from dependencyManagement even though the child pom sets the dependency version, which should override what is in dependencyManagement.  This is a regression from the correct behaviour in 2.1.
> The attached project demonstrates the problem.  The .classpath file generated for the "child" project should specify log4j-1.2.13, but instead specifies 1.28.

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

        

[jira] Commented: (MECLIPSE-107) Dependency Version Incorrectly Taken from DependencyManagement

Posted by "Damien Lecan (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MECLIPSE-107?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_90243 ] 

Damien Lecan commented on MECLIPSE-107:
---------------------------------------

I checked out last source code of maven-eclipse-plugin, svn revision 494359

Fix doesn't work : 

 - neither on my real projects,
 - nor on dmtest.zip provided test case
 - nor on MECLIPSE-107-maven-eclipse-plugin-20061211-1200.patch  provided test case too.

Debug logs on dmtest.zip provided with this bug :

{noformat}...
[INFO] Reactor build order: 
[INFO]   Unnamed - com.stephenduncanjr:dmtest:pom:1.0-SNAPSHOT
[INFO]   Unnamed - com.stephenduncanjr:dmtest-child:jar:1.0-SNAPSHOT
...
[DEBUG] org.apache.maven.plugins:maven-eclipse-plugin:maven-plugin:2.4-SNAPSHOT:runtime (selected for runtime)
...
[INFO] [eclipse:eclipse]
[DEBUG] com.stephenduncanjr:dmtest-child:jar:1.0-SNAPSHOT (selected for null)
[DEBUG]   log4j:log4j:jar:1.2.13:compile (applying version: 1.2.8;)
[DEBUG]   log4j:log4j:jar:1.2.8:compile (selected for compile)
...
{noformat} 

In com.stephenduncanjr:dmtest-child, log4j:log4j:jar:1.2.13 should have been used, but the plugin still wants to select version 1.2.8.

In the .classpath file of child module, I get that :
{noformat} 
  <classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.8/log4j-1.2.8.jar"/>
{noformat} 

> Dependency Version Incorrectly Taken from DependencyManagement
> --------------------------------------------------------------
>
>                 Key: MECLIPSE-107
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-107
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: dependency resolution
>    Affects Versions: 2.2
>            Reporter: Stephen Duncan Jr
>            Priority: Critical
>         Attachments: dmtest.zip, MECLIPSE-107-maven-eclipse-plugin-20061211-1200.patch
>
>
> The version used when generating .classpath is taken from dependencyManagement even though the child pom sets the dependency version, which should override what is in dependencyManagement.  This is a regression from the correct behaviour in 2.1.
> The attached project demonstrates the problem.  The .classpath file generated for the "child" project should specify log4j-1.2.13, but instead specifies 1.28.

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

        

[jira] Commented: (MECLIPSE-107) Dependency Version Incorrectly Taken from DependencyManagement

Posted by "Damien Lecan (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MECLIPSE-107?page=comments#action_80581 ] 
            
Damien Lecan commented on MECLIPSE-107:
---------------------------------------

I have the same problem, which is very annoying for me.

Someone could work on that ?

> Dependency Version Incorrectly Taken from DependencyManagement
> --------------------------------------------------------------
>
>                 Key: MECLIPSE-107
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-107
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: dependency resolution
>    Affects Versions: 2.2
>            Reporter: Stephen Duncan Jr
>            Priority: Critical
>         Attachments: dmtest.zip
>
>
> The version used when generating .classpath is taken from dependencyManagement even though the child pom sets the dependency version, which should override what is in dependencyManagement.  This is a regression from the correct behaviour in 2.1.
> The attached project demonstrates the problem.  The .classpath file generated for the "child" project should specify log4j-1.2.13, but instead specifies 1.28.

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

        

[jira] Commented: (MECLIPSE-107) Dependency Version Incorrectly Taken from DependencyManagement

Posted by "Andreas Guther (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MECLIPSE-107?page=comments#action_81468 ] 
            
Andreas Guther commented on MECLIPSE-107:
-----------------------------------------

Managed dependencies need to be taken into account, but they need to be overwritten by the component pom in those cases where the component pom needs to specify the version against the definition in the parent pom.   This is the behavior in Maven and must be the same in the Eclipse plugin.

I have the scenario where we manage our version in a parent pom with the dependencyManagement section.  Usually our components do not specify the version which then is taken as specified in the parent pom.  Just today I had the situation where I needed to overwrite the version in only one component for test reasons.

Getting the fix is highly appreciated.

> Dependency Version Incorrectly Taken from DependencyManagement
> --------------------------------------------------------------
>
>                 Key: MECLIPSE-107
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-107
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: dependency resolution
>    Affects Versions: 2.2
>            Reporter: Stephen Duncan Jr
>            Priority: Critical
>         Attachments: dmtest.zip
>
>
> The version used when generating .classpath is taken from dependencyManagement even though the child pom sets the dependency version, which should override what is in dependencyManagement.  This is a regression from the correct behaviour in 2.1.
> The attached project demonstrates the problem.  The .classpath file generated for the "child" project should specify log4j-1.2.13, but instead specifies 1.28.

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

        

[jira] Commented: (MECLIPSE-107) Dependency Version Incorrectly Taken from DependencyManagement

Posted by "Stephen Duncan Jr (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MECLIPSE-107?page=comments#action_66501 ] 

Stephen Duncan Jr commented on MECLIPSE-107:
--------------------------------------------

I've verified that this also affects the Netbeans plugin.  And overriding the version (or scope) in dependencyManagement in the child pom fixes the problem.  Assumably, just a dependencyManagement section is required to reproduce this, even in a single project.  What shared component might be responsible?  Can/should this issue be moved, or should I try to create a new issue for Maven overall?

> Dependency Version Incorrectly Taken from DependencyManagement
> --------------------------------------------------------------
>
>          Key: MECLIPSE-107
>          URL: http://jira.codehaus.org/browse/MECLIPSE-107
>      Project: Maven 2.x Eclipse Plugin
>         Type: Bug

>     Versions: 2.2
>     Reporter: Stephen Duncan Jr
>     Priority: Critical
>  Attachments: dmtest.zip
>
>
> The version used when generating .classpath is taken from dependencyManagement even though the child pom sets the dependency version, which should override what is in dependencyManagement.  This is a regression from the correct behaviour in 2.1.
> The attached project demonstrates the problem.  The .classpath file generated for the "child" project should specify log4j-1.2.13, but instead specifies 1.28.

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


[jira] Updated: (MECLIPSE-107) Dependency Version Incorrectly Taken from DependencyManagement

Posted by "Damien Lecan (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MECLIPSE-107?page=all ]

Damien Lecan updated MECLIPSE-107:
----------------------------------

    Attachment: MECLIPSE-107-maven-eclipse-plugin-20061211-1200.patch

Here is a patch to provide new test case to test this problem in the special plugin test environment

I added a new module-3 into the list of master-test submodules which is itself the parent of 2 new modules (submodule-1 and submodule-2)

module-3 describes a new managed dependecy (junit 2.0) which is used as-is be submodule-1 and overriden by submodule-2 (which needs version junit 3.0)

I added new helpers methods in AbstractEclipsePluginTestCase class to handle artifact version comparisons

Only "compile" scope is tested. Others scopes might be considered later (new bug to fill in ?)

> Dependency Version Incorrectly Taken from DependencyManagement
> --------------------------------------------------------------
>
>                 Key: MECLIPSE-107
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-107
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: dependency resolution
>    Affects Versions: 2.2
>            Reporter: Stephen Duncan Jr
>            Priority: Critical
>         Attachments: dmtest.zip, MECLIPSE-107-maven-eclipse-plugin-20061211-1200.patch
>
>
> The version used when generating .classpath is taken from dependencyManagement even though the child pom sets the dependency version, which should override what is in dependencyManagement.  This is a regression from the correct behaviour in 2.1.
> The attached project demonstrates the problem.  The .classpath file generated for the "child" project should specify log4j-1.2.13, but instead specifies 1.28.

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

        

[jira] Commented: (MECLIPSE-107) Dependency Version Incorrectly Taken from DependencyManagement

Posted by "Arnaud Heritier (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MECLIPSE-107?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_90215 ] 

Arnaud Heritier commented on MECLIPSE-107:
------------------------------------------

The snapshot I just deployed should have fixed this bug. Can you verify please ?

> Dependency Version Incorrectly Taken from DependencyManagement
> --------------------------------------------------------------
>
>                 Key: MECLIPSE-107
>                 URL: http://jira.codehaus.org/browse/MECLIPSE-107
>             Project: Maven 2.x Eclipse Plugin
>          Issue Type: Bug
>          Components: dependency resolution
>    Affects Versions: 2.2
>            Reporter: Stephen Duncan Jr
>            Priority: Critical
>         Attachments: dmtest.zip, MECLIPSE-107-maven-eclipse-plugin-20061211-1200.patch
>
>
> The version used when generating .classpath is taken from dependencyManagement even though the child pom sets the dependency version, which should override what is in dependencyManagement.  This is a regression from the correct behaviour in 2.1.
> The attached project demonstrates the problem.  The .classpath file generated for the "child" project should specify log4j-1.2.13, but instead specifies 1.28.

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