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

Unpacking different resources into different location from the same artifact doesn't work

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • 3.0.2
    • None
    • unpack-dependencies

    Description

      I have one artifact, in the simplest case only with two resources inside:

      ResourceArtifact-1.0.jar
      /resource1.dat
      /resource2.dat

      I want to unpack one resource into one location and the second in a different location, all this with one pom.xml:

      <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>3.0.2</version>
          <executions>
            <execution>
              <id>unpack-resource1</id>
              <goals>
                <goal>unpack-dependencies</goal>
              </goals>
              <configuration>
                <includeArtifactIds>ResourceArtifact</includeArtifactIds>
                <includes>resource1.dat</includes>
                <outputDirectory>resources1</outputDirectory>                
              </configuration>
            </execution>
            <execution>
              <id>unpack-resource2</id>
              <goals>
                <goal>unpack-dependencies</goal>
              </goals>
              <configuration>
                <includeArtifactIds>ResourceArtifact</includeArtifactIds>
                <includes>resource2.dat</includes>
                <outputDirectory>resources2</outputDirectory>                
              </configuration>
            </execution>
        </executions>
      </plugin>
      

      When I don't use (which makes not so much sense, because in fact there's nothing to overwrite):

      <overWriteReleases>true</overWriteReleases>
      <overWriteSnapshots>true</overWriteSnapshots>
      

      Then I get an info (even not a warning):

      [INFO] --- maven-dependency-plugin:3.0.2:unpack-dependencies (unpack-resource2) @ maven-unpack-same-artifact ---
      [INFO] test:ResourceArtifact:jar:1.0 already exists in destination.
      

      And the second resource is not unpacked.

      Attachments

        1. pom.xml
          2 kB
          Tomas Tulka

        Issue Links

          Activity

            People

              rfscholte Robert Scholte
              tomas.tulka Tomas Tulka
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m