Maven's way to βstartβ another assembly is to define a multi-module assembly . A parent pom project can specify modules to be built using the standard life cycle. Therefore, running mvn install on the parent will mean that each module will be built in turn.
The parent is defined using pom packagin and has a module declaration as follows:
<modules> <module>module-a</module> <module>module-b</module> </modules>
Alternatively, you can add additional artifacts to the assembly so that they are deployed next to the primary artifacts (if they have already been packaged, you can use build-helper-maven-plugin in attach any file for your pom, so it will be deployed with the specified classifier my-artifact-1.0-extra.jar following configuration attaches the specified file as my-artifact-1.0-extra.jar
<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>build-helper-maven-plugin</artifactId> <version>1.3</version> <executions> <execution> <id>attach-artifacts</id> <phase>package</phase> <goals> <goal>attach-artifact</goal> </goals> <configuration> <artifacts> <artifact> <file>/path/to/extra/file.jar</file> <type>jar</type> <classifier>extra</classifier> </artifact> </artifacts> </configuration> </execution> </executions> </plugin>
Rich seller
source share