I have a project that uses the maven-assembly-plugin to create source and binary tar and zip files for download. However, whenever I try to build the bin assembly it fails with an error that says “A tar file cannot include itself.”
I can reproduce this problem with a minimal Maven project created with the maven-archetype-plugin and adding the following to the pom.xml:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2</version>
<configuration>
<descriptorRefs>
<descriptorRef>src</descriptorRef>
<descriptorRef>bin</descriptorRef>
</descriptorRefs>
<outputDirectory>${project.build.directory}/site/downloads</outputDirectory>
</configuration>
<executions>
<execution>
<phase>site</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
With this plugin declaration in place I get the above-mentioned error message if I execute either “mvn site” or “mvn assembly:assembly”.
Does anyone have any idea why this isn’t working?
I’d be happy to provide any other information needed to help diagnose the problem.
It looks like there is a problem with version 2.2 of the Maven Assembly Plugin, your snippet works with the version 2.1 of the plugin.
I didn’t check Jira for an existing issue. If you can’t find any, it would be nice to raise a new one.