I am using maven assembly plugin to generate a .tar
file contain several other files, dependent jars. All the files are being copied correctly to the given fold
In <dependencySet>
you can exclude the current project jar by saying <useProjectArtifact>false</useProjectArtifact>
, but it's true by default, so it should work.
From the warning, it seems that you need to do mvn package
first, but due to some internal maven issue, it does not work if you do mvn package
and mvn assembly:single
in separate commands.
It works if you do mvn package assembly:single
in one command.
Alternatively, add maven-assembly-plugin in your pom and bind it to the 'package' phase so it will trigger automatically on mvn package
:
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>tar-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>etc/assembly.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>