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

dependency:unpack / needs the option of unpacking sub-directory AND ignoring parent folders

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.1.1
    • None
    • unpack
    • None
    • Windows 10 / Eclipse Maven

    Description

      The current goal is able to unpack specific sub-directory of a zip type artifact by using the "includes" parameter. However, the tree structure of the sub-directory is maintained as well.

      For example:

      myartifact-version.zip

       

      myartifact-version
       '-folder1
          '-...
       '-folder2
          '-...

      pom.xml

       

       

      ...
      <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <executions>
              <execution>
                  <id>unpack-igate-distribution</id>
                  <phase>generate-resources</phase>
                  <goals>
                      <goal>unpack</goal>
                  </goals>
                  <configuration>
                      <artifactItems>
                          <artifactItem>
                              <groupId>com.example</groupId>
                              <artifactId>myartifact</artifactId>
                              <version>${myartifact.version}</version>
                              <type>zip</type>
                              <overWrite>true</overWrite>              <outputDirectory>${project.build.directory}/myartifact</outputDirectory>
                              <includes>myartifact-*/**</includes>
                          </artifactItem>
                      </artifactItems>
                  </configuration>
              </execution>
          </executions>
      </plugin>
      ...

       

       

      Result

       

      myproject
       '-target
          '-myartifact
             '-myartifact-version
                '-folder1
                   '-...
                '-folder2
                   '-...

       

       

      However, I want to be able to change the pom.xml, to achieve the following result:

      myproject
       '-target
         '-myartifact
            '-folder1
               '-...
            '-folder2
               '-...

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            jasper.teng Jasper Teng
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: