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

processing a relocation erases requested version range

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 2.0.5, 2.0.6, 2.0.7, 2.0.8
  • Fix Version/s: Issues to be reviewed for 3.x
  • Component/s: Artifacts and Repositories
  • Labels:
    None

Description

While fixing MNG-2861, I came across a weird scenario where the contents of the relocation can affect what happens. In 2861, the relocation did not specify a version, only a group id. However, if a version is specified, in MavenMetadataSource: 164 the versionRange is reset to the contents of the relocation.getVersion(). This effectively tosses out the requested range information. We only get here after selecting the version that has been relocated, but now we have a recommended version, which can cause a different version to be selected. See the two sample projects in MNG-2861 to see how the handling is different. (brett's version has the version in the relocation and thus expresses the behavior described here)

The fix is simple, change the line to:
if ( relocation.getVersion() != null )

{ //we don't want to blast the versionRange information artifact.selectVersion( relocation.getVersion() ); }

however, I'm not certain what the ramifications of this are. The potential exists for having selected a version that no longer matches the requested version range. Say the version range was [1.0,2.0] and 2.0 was relocated to 3.0. The fix to 2861 involves reloading the available versions from the relocated artifact. This means that there is no not an artifact to match 1.0-2.0 and who knows what's going to happen.

I'm choosing to document this and not fix it for now due to the risk of instability. A search of open issues didn't result in anyone experiencing trouble with this.

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

Attachments

  1. Hide
    Zip Archive
    MNG-2861_broken.zip
    10/Mar/08 8:32 PM
    33 kB
    Brian Fox
    1. XML File
      MNG-2861/MNG-2861/A/pom.xml 0.8 kB
    2. Java Source File
      MNG-2861/MNG-2861/A/.../java/test/App.java 0.2 kB
    3. Java Source File
      MNG-2861/MNG-2861/A/.../test/AppTest.java 0.7 kB
    4. XML File
      MNG-2861/MNG-2861/B/pom.xml 0.7 kB
    5. Java Source File
      MNG-2861/MNG-2861/B/.../java/test/App.java 0.2 kB
    6. Java Source File
      MNG-2861/MNG-2861/B/.../test/AppTest.java 0.7 kB
    7. Java Archive File
      MNG-2861/MNG-2861/.../B-1.0-SNAPSHOT.jar 2 kB
    8. File
      MNG-2861/MNG-2861/B/.../test/App.class 0.5 kB
    9. Text File
      MNG-2861/MNG-2861/.../test.AppTest.txt 0.3 kB
    10. XML File
      MNG-2861/MNG-2861/.../TEST-test.AppTest.xml 5 kB
    11. File
      MNG-2861/MNG-2861/B/.../test/AppTest.class 1 kB
    12. XML File
      MNG-2861/MNG-2861/C/pom.xml 0.7 kB
    13. Java Source File
      MNG-2861/MNG-2861/C/.../java/test/App.java 0.2 kB
    14. Java Source File
      MNG-2861/MNG-2861/C/.../test/AppTest.java 0.7 kB
    15. Java Archive File
      MNG-2861/MNG-2861/.../C-1.0-SNAPSHOT.jar 2 kB
    16. File
      MNG-2861/MNG-2861/C/.../test/App.class 0.5 kB
    17. Text File
      MNG-2861/MNG-2861/.../test.AppTest.txt 0.3 kB
    18. XML File
      MNG-2861/MNG-2861/.../TEST-test.AppTest.xml 5 kB
    19. File
      MNG-2861/MNG-2861/C/.../test/AppTest.class 1 kB
    20. XML File
      MNG-2861/MNG-2861/pom.xml 0.8 kB
    21. Java Archive File
      MNG-2861/repository/.../1.2/project-1.2.jar 2 kB
    22. File
      MNG-2861/repository/.../project-1.2.jar.md5 0.0 kB
    23. File
      MNG-2861/repository/.../project-1.2.jar.sha1 0.0 kB
    24. File
      MNG-2861/repository/.../1.2/project-1.2.pom 0.8 kB
    25. File
      MNG-2861/repository/.../project-1.2.pom.md5 0.0 kB
    26. File
      MNG-2861/repository/.../project-1.2.pom.sha1 0.0 kB
    27. Java Archive File
      MNG-2861/repository/.../2.0/project-2.0.jar 2 kB
    28. File
      MNG-2861/repository/.../project-2.0.jar.md5 0.0 kB
    29. File
      MNG-2861/repository/.../project-2.0.jar.sha1 0.0 kB
    30. File
      MNG-2861/repository/.../2.0/project-2.0.pom 0.8 kB
    Showing 30 of 53 items Download Zip
    Show
    Zip Archive
    MNG-2861_broken.zip
    10/Mar/08 8:32 PM
    33 kB
    Brian Fox
  2. GZip Archive
    MNG-2861.tar.gz
    10/Mar/08 8:32 PM
    11 kB
    Brian Fox

Issue Links

relates to

Bug - A problem which impairs or prevents the functions of the product. MNG-2861 NullPointerException in DefaultArtifactCollector for relocated resolvedArtifacts with different version ranges and available versions.

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

  • All
  • Comments
  • Work Log
  • History
  • Activity
There are no comments yet on this issue.

People

  • Assignee:
    Unassigned
    Reporter:
    Brian Fox
Vote (0)
Watch (0)

Dates

  • Created:
    10/Mar/08 8:27 PM
    Updated:
    20/Sep/10 11:12 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.