Uploaded image for project: 'Maven Assembly Plugin'
  1. Maven Assembly Plugin
  2. MASSEMBLY-701

class AddDependencySetsTask doesn't re-unpack contents of unpacked SNAPSHOT artifacts

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4
    • 2.5.1
    • dependencySet
    • None
    • Apache Maven 3.2.1, Oracle Java SE Runtime Environment (build 1.8.0-b132)

    Description

      Simple project test-Maven.zip to reproduce the problem is attached.

      Test case scenario:
      1) Upack test-Maven.zip into test-Maven directory.
      2) Run mvn package from the test-Maven directory.
      3) Check that content of the file test-Maven\p2\target\p2-0.0.0-SNAPSHOT-myClassifier.zip\content.txt is "some content".
      4) Check that content of the file test-Maven\target\p1-0.0.0-SNAPSHOT-myClassifier.zip\myClassifier\content.txt is "some content" (p2 assembly packs content of p2-0.0.0-SNAPSHOT-myClassifier.zip into p1-0.0.0-SNAPSHOT-myClassifier.zip).
      5) Modify content of the file test-Maven\p2\src\myClassifier\content.txt (e.g. write "a new content").
      6) Same as 2). Run mvn package from the test-Maven directory.
      7) Check that content of the file test-Maven\p2\target\p2-0.0.0-SNAPSHOT-myClassifier.zip\content.txt has changed to "a new content".
      8) Check that content of the file test-Maven\target\p1-0.0.0-SNAPSHOT-myClassifier.zip\myClassifier\content.txt is still "some content" and not "a new content" (! bug).

      Assembly plugin unpacks content of p2-0.0.0-SNAPSHOT-myClassifier.zip into the directory test-Maven\target\assembly\work\test_p2_0.0.0-SNAPSHOT_myClassifier.zip and never unpacks p2-0.0.0-SNAPSHOT-myClassifier.zip again if working directory exists. That is assembly plugin ignores the fact that p2-0.0.0-SNAPSHOT-myClassifier.zip is a SNAPSHOT (the version of p2 is 0.0.0-SNAPSHOT).

      It seems like the corresponding code is in the line 238 (if ( dir.exists() )) in the class org.apache.maven.plugin.assembly.archive.task.AddDependencySetsTask.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            krosenvold Kristian Rosenvold
            male Valentin Kovalenko
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment