Uploaded image for project: 'Maven Dependency Plugin'
  1. Maven Dependency Plugin
  2. MDEP-515

Unpack does not work on Linux

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • 2.8, 2.10
    • None
    • unpack
    • None

    Description

      I had the following plugin configuration for maven-dependency-plugin:

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>unpack-content</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>groupId</groupId>
                  <artifactId>artifactId</artifactId>
                  <version>${project.version}</version>
                  <type>war</type>
                  <overWrite>true</overWrite>
                  <outputDirectory>${project.build.directory}/../src/main/webapp</outputDirectory>
                  <includes>WEB-INF/*.xml</includes>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>
      

      Linux Debug output:

      [DEBUG] -- end configuration --
      [INFO] Configured Artifact: groupId:artifactId:1.2.3-SNAPSHOT:war
      [INFO] Unpacking /home/jenkins/workspace/BUILD/module/webgui.war to /home/jenkins/workspace/BUILD/other-module/target/../src/main/webapp with includes "WEB-INF/*.xml" and excludes ""
      [DEBUG] Found unArchiver by type: org.codehaus.plexus.archiver.zip.ZipUnArchiver$__plexus2@37a65ac9
      [DEBUG] Expanding: /home/jenkins/workspace/BUILD/module/webgui.war into null
      [DEBUG] expand complete
      

      Windows Debug output:

      [DEBUG] -- end configuration --
      [INFO] Configured Artifact: groupId:artifactId:1.2.3-SNAPSHOT:war
      [INFO] Unpacking C:\ws\BUILD\module\webgui.war to C:\ws\BUILD\other-module\target\..\src\main\webapp with includes "WEB-INF/*.xml" and excludes ""
      [DEBUG] Found unArchiver by type: org.codehaus.plexus.archiver.zip.ZipUnArchiver$__plexus2@7d6c3feb
      [DEBUG] Expanding: C:\ws\BUILD\module\webgui.war into C:\ws\BUILD\other-module\target\..\src\main\webapp
      [DEBUG] expand complete
      [INFO] 
      

      Apart from the configuration which should be done differently, for example using different phase like prepare-package and of course differerent outputDirectory like ${project.build.outputDirectory} it should work which is not the case.

      The problem seemed to be related based on the markersDirectory which is used by maven-dependency-plugin which looks like it is not created during the running of maven-dependency-plugin which seemed to be related to the early life cycle phase.
      I have changed the binding to a later life cycle phase which means the target/classes folder will be created by previous phases.

      Attachments

        Activity

          People

            Unassigned Unassigned
            khmarbaise Karl Heinz Marbaise
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: