jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 2 & 3
  • MNG-2931

DefaultArtifactCollector changes the version of the originatingArtifact if it's in the dependencyManagement with another version

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Cannot Reproduce
  • Affects Version/s: 2.0.5, 2.0.6
  • Fix Version/s: None
  • Component/s: Artifacts and Repositories
  • Labels:
    None
  • Complexity:
    Intermediate

Description

DefaultDependencyTreeBuilder
https://svn.apache.org/repos/asf/maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/tree/DefaultDependencyTreeBuilder.java

calls collect like this

collector.collect( project.getDependencyArtifacts(), project.getArtifact(), managedVersions, repository,
project.getRemoteArtifactRepositories(), metadataSource, null,
Collections.singletonList( listener ) );

Problem:
This pom
http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-component-api/1.0-alpha-22/plexus-component-api-1.0-alpha-22.pom
extends
http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-containers/1.0-alpha-22/plexus-containers-1.0-alpha-22.pom
that in dependencyManagement has org.codehaus.plexus:plexus-component-api:1.0-alpha-19

so during collect project.getArtifact().getVersion() is changed to the managedVersion instead of the original one

Either this is a bug or an exception should be thrown when originatingArtifact is in managedVersions

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Text File
    MNG-2931.patch
    04/Apr/07 8:32 PM
    1 kB
    Carlos Sanchez

Issue Links

is related to

Bug - A problem which impairs or prevents the functions of the product. MNG-2919 Scope defined in dependencyManagement section of parent pom overwrites scope of current artifact

  • Critical - Crashes, loss of data, severe memory leak.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Carlos Sanchez added a comment - 04/Apr/07 8:32 PM

unit test

Show
Carlos Sanchez added a comment - 04/Apr/07 8:32 PM unit test
Hide
Permalink
Carlos Sanchez added a comment - 04/Apr/07 8:35 PM

The question is do we allow a project to extend another one that has a different version of it in dependencyManagement ?
if we do, then the current project version has to win over the managed one

Show
Carlos Sanchez added a comment - 04/Apr/07 8:35 PM The question is do we allow a project to extend another one that has a different version of it in dependencyManagement ? if we do, then the current project version has to win over the managed one
Hide
Permalink
Carlos Sanchez added a comment - 04/Apr/07 8:46 PM

Seems logical to fail the build if dependencyManagement and the project version don't match

Show
Carlos Sanchez added a comment - 04/Apr/07 8:46 PM Seems logical to fail the build if dependencyManagement and the project version don't match
Hide
Permalink
Joerg Schaible added a comment - 05/Apr/07 12:18 AM

The version of the current artifact has to win! See, we manage all our versions in a global POM and that includes also our released artifacts. However, they are depending on each other. So it is quite normal that an artifact inherits a version from the global POM, but will declare a SNAPSHOT on its own.

Show
Joerg Schaible added a comment - 05/Apr/07 12:18 AM The version of the current artifact has to win! See, we manage all our versions in a global POM and that includes also our released artifacts. However, they are depending on each other. So it is quite normal that an artifact inherits a version from the global POM, but will declare a SNAPSHOT on its own.
Hide
Permalink
Carlos Sanchez added a comment - 05/Apr/07 12:49 PM

I can see a cycle

the child can't be released until the parent is
if the parent is released with a released version of the child in depMngmt the child wouldn't run again as its version is still snapshot

Show
Carlos Sanchez added a comment - 05/Apr/07 12:49 PM I can see a cycle the child can't be released until the parent is if the parent is released with a released version of the child in depMngmt the child wouldn't run again as its version is still snapshot
Hide
Permalink
Carlos Sanchez added a comment - 06/Apr/07 1:33 PM

I added a workaround to the code to avoid changing the originating artifact version until a better solution.

Show
Carlos Sanchez added a comment - 06/Apr/07 1:33 PM I added a workaround to the code to avoid changing the originating artifact version until a better solution.
Hide
Permalink
Chris Wewerka added a comment - 24/Apr/07 5:54 AM

Very, very ugly effect of this bug is that already deployed versions are overwritten by newer versions without notice. Maven changes the artifact version to the managed version and deploys it to the repository

Show
Chris Wewerka added a comment - 24/Apr/07 5:54 AM Very, very ugly effect of this bug is that already deployed versions are overwritten by newer versions without notice. Maven changes the artifact version to the managed version and deploys it to the repository
Hide
Permalink
John Casey added a comment - 09/Jul/08 4:53 PM

For clarity, the attached patch has already been applied. (MNG-2931.patch)

Show
John Casey added a comment - 09/Jul/08 4:53 PM For clarity, the attached patch has already been applied. (MNG-2931.patch)
Hide
Permalink
John Casey added a comment - 09/Jul/08 4:55 PM

We need a clear test case for this issue, or it's going to be nearly impossible to be sure we have it located and fixed.

Show
John Casey added a comment - 09/Jul/08 4:55 PM We need a clear test case for this issue, or it's going to be nearly impossible to be sure we have it located and fixed.

People

  • Assignee:
    Unassigned
    Reporter:
    Carlos Sanchez
Vote (2)
Watch (3)

Dates

  • Created:
    04/Apr/07 8:31 PM
    Updated:
    30/Dec/09 10:39 AM
    Resolved:
    30/Dec/09 10:39 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.