2
votes

The goal is to create a single ZIP file, but split the configuration of the Maven Assembly plugin into a general and more specific descriptor.

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-assembly-plugin</artifactId>
    <version>3.0.0</version>
    <configuration>
        <descriptors>
            <descriptor>${project.basedir}/../src/assembly/rest-executables.xml</descriptor>
            <descriptor>${project.basedir}/../../src/assembly/deliverables.xml</descriptor>
        </descriptors>
    </configuration>
    <executions>
        <execution>
            <id>make-assembly</id>
            <phase>package</phase>
            <goals>
                <goal>single</goal>
            </goals>
        </execution>
    </executions>
</plugin>

However, when the two custom descriptors have unique IDs, two ZIP files are created - each with the expected contents. When the IDs are identical, only the last descriptor is executed (or it overwrites the previous contents).

Is what I'm attempting not possible or am I missing an option somewhere like 'append to existing ZIP' rather than 'always create new ZIP'?

1
Would component descriptors work for your use case? It allows splitting config into multiple files, then using the components in one or more descriptors. - user944849
Thanks. At a glance, it seems to address my issue. - morsor
The given directories for your descriptors look weird.... - khmarbaise
@khmarbaise In which way? - morsor
Cause you are using things like /../.. etc. which looks like you have the descriptors somewhere else than the current project needs them.... - khmarbaise

1 Answers

1
votes

I was able to reproduce the issue and fixed it by for removing inner descriptor tags

<configuration>
    <descriptors>${project.basedir}/../src/assembly/rest-executables.xml,${project.basedir}/../../src/assembly/deliverables.xml</descriptors>
</configuration>

It started to produce artifacts as expected. After reverting inner elements back I was not able to reproduce the issue.