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

<excludes /> an <includes /> patterns do not work with .tar.gz packaging

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.0, 2.1
    • None
    • unpack
    • None

    Description

      I have created a myapp-1.0-jar-with-dependencies.tar.gz file using the maven-assembly-plugin:

      <?xml version="1.0" encoding="UTF-8"?>
      <assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
      
      	<id>jar-with-dependencies</id>
      	<formats>
      		<format>tar.gz</format>
      	</formats>
      	<includeBaseDirectory>false</includeBaseDirectory>
      	
      	<!-- include any .jar dependencies we need in runtime scope -->
      	<dependencySets>
      		<dependencySet>
      			<useStrictFiltering>true</useStrictFiltering>
      			<scope>runtime</scope>
      			<includes>
      				<include>*:jar:*</include>
      			</includes>
      		</dependencySet>
      	</dependencySets>
      </assembly>
      

      Now I want to unpack myapp-1.0-jar-with-dependencies.tar.gz to another maven project's target directory, but exclude some of the files in the .tar.gz file:

      <plugin>
      	<artifactId>maven-dependency-plugin</artifactId>
      	<executions>
      		<execution>
      			<id>copy-to-shared-folder</id>
      			<phase>generate-sources</phase>
      			<goals>
      				<goal>unpack</goal>
      			</goals>
      			<configuration>
      				<artifactItems>
      					<artifactItem>
      						<groupId>my.group.id</groupId>
      						<artifactId>myapp</artifactId>
      						<version>1.0</version>
      						<classifier>jar-with-dependencies</classifier>
      						<type>tar.gz</type>
      						<includes>**/*.*</includes>
      						<excludes>**/bad-file.jar,**/some-stuff.log</excludes>
      						<outputDirectory>${project.build.directory}/myapp-libs</outputDirectory>
      					</artifactItem>
      				</artifactItems>
      				<overWriteReleases>true</overWriteReleases>
      				<overWriteSnapshots>true</overWriteSnapshots>
      			</configuration>
      		</execution>
      	</executions>
      </plugin>
      

      However, the <includes /> and <excludes /> sections are completely ignored here.

      I have noticed that for <type>zip</type> dependencies the include/exclude filters are working as expected, but I would assume that it should for for .tar.gz as well

      Attachments

        Issue Links

          Activity

            People

              brett Brett Porter
              tknerr Torben Knerr
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: