...
- Create a simple jar module
Your project just need to contain the assambly descriptor file (the directory "assemblies" is required):Code Block <project ...> <artifactId>myAssemblies</artifactId> <groupId>com.mycompany.mygroup</groupId> <version>1.0.0</version> <packaging>jar</packaging> </project>
src\/main\/resources\/assemblies/my-distribution.xml
the name of your assembly ("my-distribution") is the refId that will be use in descriptorRef tag.
In this project be sure to disable filtering on resources folder otherwise variables like ${artifactId} will be replaced.... - Then in a pom parent (my-pom-parent) you need to declare the assembly configuration:
"pluginManagement" is used in this example, but you can directly use "plugins" tag in your project.Code Block <build> <pluginManagement> <plugins> <plugin> <artifactId>maven-assembly-plugin</artifactId> <configuration> <descriptorRefs> <descriptorRef>my-distribution</descriptorRef> </descriptorRefs> </configuration> <executions> <execution> <id>my-assembly</id> <phase>package</phase> <goals> <goal>assembly</goal> </goals> </execution> </executions> <dependencies> <dependency> <groupId>com.mycompany.mygroup</groupId> <artifactId>myAssemblies</artifactId> <version>1.0.0</version> </dependency> </dependencies> </plugin> </plugins> </pluginManagement> </build> - And Then in your project (that inherite from the "my-pom-parent") you just need to declare the usage of the assembly plugin:
Of course you can overwrite default plugin configuration.Code Block <build> <plugins> <plugin> <artifactId>maven-assembly-plugin</artifactId> </plugin> </plugins> </build>
...
