Search code examples
mavenmaven-pluginmaven-assembly-plugin

suffix of the generated tar.gz in maven assembly plugin


Maven assembly plugin adds a suffix to the generated tar.gz which value is value of the <id> when there are more than one descriptor files, like here:

<descriptors>
    <descriptor>src/main/assembly/bin-descriptor.xml</descriptor>
    <descriptor>src/main/assembly/test-descriptor.xml</descriptor>
</descriptor>

generated files are: project-1.0.0-bin.tar.gz and project-1.0.0-test.tar.gz. When there is only one file in the descriptors, like here:

<descriptors>
    <descriptor>src/main/assembly/bin-descriptor.xml</descriptor>
</descriptor>

the output is: project-1.0.0.tar.gz. How to force maven assembly to add a suffix to the name when there is only one file?


Solution

  • It's strange, I'm using Maven 3.0.1 and it also adds the assembly id as a prefix when I use only one descriptor. It's the default behaviour I think.

    Try to force it configuring the appendAssemblyId to true.