I have a multi-module project and want to create a single jar containing the classes of all my modules. Inside my parent POM, I declared the following plugin:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>bin</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
However, when running mvn assembly:assembly, only the source from the parent folder (empty) are included. How do I include the sources from my modules into the archive?
I think you are looking for the Maven Shade Plugin:
http://maven.apache.org/plugins/maven-shade-plugin/index.html
Packages up any number of dependencies into an uber package depenency. This can then be deployed to a repository.
To package classes from all modules to a single jar I did the following:
Created additional module that is used only for packing contents of all other modules to a single jar. This is usually reffered to as a assembly module. Try calling this module same as target jar file.
In pom.xml of this new module i added maven-assemby-plugin. This plugin packages all classes and puts them in single file. It uses additional configuration file (step 4.)
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>go-framework-assemby</id>
<phase>package</phase><!-- create assembly in package phase (invoke 'single' goal on assemby plugin)-->
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>src/main/assemble/framework_bin.xml</descriptor>
</descriptors>
<finalName>framework</finalName>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
3.In pom.xml of this new module I also added dependencies to all other modules including parent pom. Only modules included in dependencies will be packed in target jar file.
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>fwk-bam</artifactId>
<version>${project.version}</version>
</dependency>...
4.Finally i created assembly descriptor in assembly module (file: src/main/assemble/framework_bin.xml)
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>all-jar</id>
<formats>
<format>jar</format> <!-- the result is a jar file -->
</formats>
<includeBaseDirectory>false</includeBaseDirectory> <!-- strip the module prefixes -->
<dependencySets>
<dependencySet>
<unpack>true</unpack> <!-- unpack , then repack the jars -->
<useTransitiveDependencies>false</useTransitiveDependencies> <!-- do not pull in any transitive dependencies -->
</dependencySet>
</dependencySets>
</assembly>
The predefined bin won't do the trick here. You'll have to use a custom descriptor similar to the predefined bin descriptor but that declares moduleSet to include your project modules.
Related
I need to separate the jars into different folders.
Inside my project, I have several modules, i.e: module1, module2, and assembly.
By using maven assembly plugin, I would like to put generated jar from modules1 and module2 into target/modules and all the dependencies into target/dependencies.
How can I achieve this requirement?
Thanks
Based on the fact that your project is structured like :
project
|- module1
|- module2
|- assembly
|- pom.xml
|- src
|- assembly
|- bin.xml
assembly should depend on module1 and module2; set these dependencies in assembly/pom.xml :
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>module1</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>module2</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
You must also add maven-assembly-plugin in assembly/pom.xml :
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<descriptors>
<descriptor>src/assembly/bin.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
assembly:single is bound on package phase, to create the assembly when running mvn package.
Finally, define assembly/src/assembly/bin.xml as follows :
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
<id>bin</id>
<formats>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet>
<outputDirectory>modules</outputDirectory>
<includes>
<include>${project.groupId}:*:*</include>
</includes>
<excludes>
<exclude>${project.groupId}:${project.artifactId}:*</exclude>
</excludes>
</dependencySet>
<dependencySet>
<useTransitiveDependencies>true</useTransitiveDependencies>
<outputDirectory>dependencies</outputDirectory>
<excludes>
<exclude>${project.groupId}:*:*</exclude>
</excludes>
</dependencySet>
</dependencySets>
</assembly>
format defines the format you want for the assembly (here a directory, but could be tar.gz, zip, ...)
first dependencySet defines a folder modules/ where all artifacts from the same groupId will be put. Here you can also control if you want only some of the artifacts (for example if you want only module1). assembly JAR is excluded from this folder, as this module is only used to create the assembly
second dependencySet defines a folder dependencies/ where all dependencies (and transitive dependencies) will be put. Dependency here means artifact with a different groupId, as states the excludes clause
mvn package will then generate the assembly (in assembly/target/ folder), named assembly-${project.version}-bin, with the structure you want.
I'm using Maven to build a multi module project;
which comprises of 9 war modules
Each module has its own POM containing instructions on how to package;
<packaging>war</packaging>
A parent POM is then responsible for initiating the Maven lifecycle on each module and pushing to an artifact manager (Nexus)
<modules>
<module>module1</module>
<module>module2....
I would like to use the assembly plugin to package each of the WAR files which were built earlier by each module into a single ZIP file. I'm attempting to do this by defining an assembly descriptor in the parent POM which defines a separate dependencySet for each of the modules (using groupID, artifactID and version to find the WAR in my local repo).
I've tried to achieve this using the following assembly file;
<assembly>
<id>war</id>
<includeBaseDirectory>false</includeBaseDirectory>
<formats>
<format>zip</format>
</formats>
<dependencySets>
<dependencySet>
<useProjectArtifact>false</useProjectArtifact>
<includes>
<include>com:test-web:war:${pom.version}</include>
</includes>
<outputFileNameMapping>test-web.war</outputFileNameMapping>
</dependencySet>
</dependencySets>
</assembly>
And this is the plugin configuration in my parent POM;
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.5.3</version>
<executions>
<execution>
<id>distribution-package</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<runOnlyAtExecutionRoot>true</runOnlyAtExecutionRoot>
<descriptors>
<descriptor>assembly.xml</descriptor>
</descriptors>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
</configuration>
</execution>
</executions>
</plugin>
Is this approach on the right track?
Additionally does it make sense to pull the WAR files from my local repo? Should i be using the output in each of the sub modules target folders instead?
1) In your parent pom I would go like
<modules>
<module>module1</module>
<module>distibution</module>
<module>module2....
(create an extra module for the distribution) In order to separate the parent pom from the distribution.
2) You should not be using the output in each of the sub modules target folders. Add all wars as dependencies of the distribution. In that way maven can know that it must build the distribution LAST.
3) Tip: replace ${pom.version} with ${project.version} (I think the former is deprecated if it works at all)
I am working on a core Java project. I am writing an Apache Storm topology and need to exclude storm jars while binding the topology into jar. Is there any way to do this without using maven? I know with maven we can use <scope>provided</scope> but I need an alternative to this.
PS: I am using Eclipse.
I use Gradle for compiling the JAR files for topologies. It allows you to exclude certain files when generating JAR files.
The example below shows the set-up that I use in my build.gradle file
apply plugin: 'java'
apply plugin: 'eclipse'
configurations {
provided
compile.extendsFrom provided
}
jar {
dependsOn configurations.runtime
from {
(configurations.runtime - configurations.provided).collect {
it.isDirectory() ? it : zipTree(it)
}
}
manifest {
attributes 'Main-Class': 'com.example.myclass'
}
}
dependencies {
provided files('./lib/asm-4.0.jar')
provided files('./lib/carbonite-1.4.0.jar')
# ... The rest of the Storm jars found in the lib directory of your storm installation
}
By default the directory structure Gradle expects is
MyProjectName
- build.gradle
- src
- main
- java
- [Your Java Files]
- resources
- resources
- [Mutlilang files / other resources]
From the command line when you run gradle build in the directory containing your build.gradle file a JAR file should be generated under .\build\libs
There is also a Gradle plugin for eclipse
If you are using Maven instead of Gradle, and you come here for excluding lib of Storm in building, I have the solution and a working example.
The documentation of Storm tells us to exclude the Storm dependency and provides a link to a page of Maven, which explains how to do it but it lacks a full example. It turns out that we have to create another XML file as the descriptor of assembly configuration, instead of putting the configuration directly in the pom.xml, even when Eclipse does not complain about putting the two files together.
Here is how:
We have our pom.xml with assembly plugins, pointing to another descriptor xml file:
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>make-assembly</id> <!-- this is used for inheritance merges -->
<phase>package</phase> <!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<descriptors>
<descriptor>/src/main/resources/exclude-storm.xml</descriptor>
</descriptors>
<archive>
<manifest>
<mainClass>path.to.main.class</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
Note the part of: (should be complete path)
<descriptors>
<descriptor>/src/main/resources/exclude-storm.xml</descriptor>
</descriptors>
And in this path:
<?xml version="1.0" encoding="UTF-8"?>
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd">
<id>exclude-storm</id>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet>
<outputDirectory>/</outputDirectory>
<useProjectArtifact>false</useProjectArtifact>
<unpack>true</unpack>
<scope>compile</scope> <!-- note here!!!! -->
<excludes>
<exclude>org.apache.storm:storm-core:jar:1.1.1</exclude>
</excludes>
</dependencySet>
</dependencySets>
<fileSets>
<fileSet>
<outputDirectory>/</outputDirectory>
<directory>${project.build.outputDirectory}</directory>
</fileSet>
</fileSets>
</assembly>
Here we add the settings of Maven doc page.
The most important thing: format of exclusion: should be: (ref)
groupId:artifactId:type[:classifier]:version
And the scope! runtime is default, I changed it to compile and it works.
At last, when you compile, use:
clean assembly:assembly
And turn on debug output to see full output in console. If you:
have a successful build
search the output and haven't found anything like: [WARNING]The following patterns were never triggered in this artifact inclusion filter: o 'org.apache.storm:storm-core:jar:1.1.1'.
the jar contains no default.yaml
Then you know you have succeeded.
Thanks for the inspiration of another question and answers: How to exclude dependencies from maven assembly plugin : jar-with-dependencies?
I have this Maven project structure:
-- top
-- a
produces a.jar and a-capsule-fat.jar
-- b
produces b.jar and b-capsule-fat.jar
-- pkg
produces all.tar.gz, which contains a-capsule.jar and b-capsule.jar
I am using the capsule-maven-plugin to build fat jars in a couple of projects, as shown above. Normally capsule is run during the package phase. I then want to assemble the capsule jars into a tar.gz for deployment purposes. I am using the maven-assembly-plugin in project pkg to make the tar.
But the maven-assembly-plugin also normally runs during the package phase, and it's running before the capsule jars are created.
Can I specify a assembly dependency or ordering that will force maven to create the capsule jars first? Alternatively I could build the assembly in a later phase, but there are no really suitable later ones (in install? there is no post-package).
POST-ANSWER: I am including some pieces of the working code for posterity:
dependencies in pkg/pom.xml:
<dependency>
<groupId>thegroup</groupId>
<artifactId>a</artifactId>
<version>theVersion</version>
<type>jar</type>
<classifier>capsule-fat</classifier>
</dependency>
<dependency>
<groupId>thegroup</groupId>
<artifactId>b</artifactId>
<version>theVersion</version>
<type>jar</type>
<classifier>capsule-fat</classifier>
</dependency>
assembly plugin settings in pkg/pom.xml:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>build-tar</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<descriptors>
<descriptor>src/main/assembly/pkg.xml</descriptor>
</descriptors>
</configuration>
</plugin>
pkg.xml (referenced above):
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>ustc-archive-pkg</id>
<formats>
<format>tar.gz</format>
</formats>
<dependencySets>
<dependencySet>
<includes>
<include>*:jar:capsule-fat</include>
</includes>
</dependencySet>
</dependencySets>
</assembly>
Make sure the definition for the capsule-maven-plugin appears before the maven-assembly-plugin. When there are executions bound to the same phase, Maven uses the order of the plugin definitions in the POM to break the tie.
---- edit ----
Make sure the dependencies on a and b include a classifier:
<dependency>
<groupId>theGroup</groupId>
<artifactId>a</artifactId>
<version>theVersion</version>
<classifier>capsule-fat</classifier>
</dependency>
See if that does it.
I have a multi-module project, where each module is packaged as an OSGi bundle using the Apache Felix maven-bundle-plugin. The whole project is built using a parent POM that lists the above-mentioned modules. Some modules contain configuration resources (e.g. .properties files) that should not be jarred inside the bundles for deployment but rather externalized in a dedicated config folder. My goal is to create a distribution folder (possibly, a zip file) that would look something like this:
my-app-distribution
/bundles
module1-bundle.jar
module2-bundle.jar
etc.
/conf
external1.properties
external2.properties
etc.
where the properties files under the /conf directory are hand-picked files from the individual modules' /target folders. The reason the .properties files need to be picked up from the target folders vs. the src folders is that I am using Maven resource filtering, and the source property files contain ${..} placeholders for environment-specific values. Those placeholders are properly resolved during the build process - per build profiles - and the target/ folders contain actual environment-specific values.
I've done such distribution file manipulations many times - for distributions with executable JARs, etc. In this case I wanted to use the "moduleSets" configuration of the assembly descriptor - it is easy to pull all binaries/jars into a single distribution folder using moduleSet/binary descriptor. It is also easy to exclude certain files from being packaged into an OSGi bundle - in the maven-bundle-plugin. The only issue I am stuck with is creating the /conf distribution folder and collecting the necessary properties files there. I have tried to use "fileSets" inside the "moduleSet/sources" descriptor to include only specific files from **/target of each module, but that didn't seem to work.
Anyone have a suggestion/advice? There's got to be an easy way. Or should I not use at all?
Thanks,
CV
#PetrKozelka I am not sure that extracting configuration files specific to different bundles into a separate module is a good idea. The whole point of OSGi is for bundles to be independent and potentially reusable - both in development and distributions. It only makes sense that - in the source code - the functionality implementation and related configuration files are grouped together. For a particular distribution though I might need to extract some of the files - if there is a requirement for admins to have control of certain parameters. That may be different for a different distribution/application. The assembly configuration may change, but the bundles/sources would stay the same. Also, each bundle may potentially be developed and used separately, not all bundles have to always be part of the same uber project - as you seem to assume. What you are suggesting seems to fall into the same old category of packaging enterprise applications by the type of artifacts (e.g. "model", "services", "dataaccess", "config" etc.), not by functional domain/features. Such approach works ok within a single application/project, but fails on the enterprise level where there is often a need to reuse subsets of vertical components (split by functional domains).
To your point of being dependent on the file layout in the modules, I agree that there should be no such dependency. Files could be hand-picked by their explicit name or naming convention - per very specific distro requirements. (Which is exactly the case I am facing.)
I have actually figured out how to do it more or less elegantly. Posting the solution below in case someone else is looking to solve a similar problem.
SUMMARY
I am using the maven-assembly-plugin to extract the binaries (bundle JARs) from the individual modules and package them in the <my-distribution-folder>/bundles directory. In each module where some resource files should be externalized, I consolidate such files under the /src/main/resources/external directory, and use maven-resources-plugin to copy those resources during the packaging phase to the auto-generated directory in my dedicated distribution module that contains the assembly.xml descriptor file and is also built as part of the top project. I use maven-clean-plugin in the parent POM to clear the contents of the distribution staging directory during the CLEAN phase of the top-level project build.
MAVEN CONFIGURATION
Inside each bundle's module POM that contains resources that need to be externalized I add the following resource management configuration:
<build>
<defaultGoal>install</defaultGoal>
<!--
enable resource filtering for resolving ${...} placeholders with environment-specific values
exclude any files that must be externalized
-->
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<excludes>
<exclude>external/*.*</exclude>
</excludes>
</resource>
</resources>
...
<plugins>
<!-- Copies contents of resources/external to dedicated folder defined by property in parent -->
<!-- externalized resources will be packaged according to assembly instructions -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>
${project.parent.basedir}/${externalizableResourcesStageDir}
</outputDirectory>
<resources>
<resource>
<directory>src/main/resources/external</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<!-- builds a JAR file for this bundle -->
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
<Import-Package>*</Import-Package>
<Export-Package>
${project.groupId}.thismodulepackage*;version=${project.version}
</Export-Package>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
where externalizableResourcesStageDir is a property defined in the top/parent POM. In the project, I include a special distribution module with the following structure:
distribution
/ext-resources (target auto-generated dir for external resources from modules)
/src
/assemble
assembly.xml (assembly descriptor)
The assembly.xml file looks like this:
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2
http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>bin</id>
<!-- generate a ZIP distribution -->
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<baseDirectory>/</baseDirectory>
<moduleSets>
<moduleSet>
<!-- Enable access to all projects in the current multi-module build -->
<useAllReactorProjects>true</useAllReactorProjects>
<!-- select projects to include-->
<includes>
<include>myGroupId:myModuleArtifactId1</include>
<include>myGroupId:myModuleArtifactId2</include>
...
</includes>
<!-- place bundle jars under /bundles folder in dist directory -->
<binaries>
<outputDirectory>${artifactId}/bundles</outputDirectory>
<unpack>false</unpack>
</binaries>
</moduleSet>
</moduleSets>
<!-- now take files from ext-resources in this module and place them into dist /conf subfolder-->
<fileSets>
<fileSet>
<directory>ext-resources</directory>
<outputDirectory>${artifactId}/conf/</outputDirectory>
<includes>
<include>*</include>
</includes>
</fileSet>
</fileSets>
</assembly>
The distribution module's POM would look like this:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>myGroupId</groupId>
<artifactId>parentArtifactId</artifactId>
<version>...</version>
</parent>
<groupId>myGroupId</groupId>
<artifactId>distribution</artifactId>
<version>...</version>
<packaging>pom</packaging>
<name>Distribution</name>
<description>This module creates the <MyProject> Distribution Assembly</description>
<url>http:...</url>
<!-- NOTE: These dependency declarations are only required to sort this project to the
end of the line in the multi-module build.
-->
<dependencies>
<dependency>
<groupId>myGroupId</groupId>
<artifactId>myModuleArtifactId1</artifactId>
<version>${project.version}</version>
</dependency>
...
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>dist-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptors>
<descriptor>src/assemble/assembly.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
The parent POM would list all the bundle modules, plus the distribution module and also define the assembly plugin:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>myGroupId</groupId>
<artifactId>myParentId</artifactId>
<version>...</version>
<packaging>pom</packaging>
<properties>
...
<!-- directory where build may place any sub-modules' resources that should be externalized -->
<!-- those resources may be picked up by maven-assembly-plugin and packaged properly for distribution -->
<externalizableResourcesStageDir>
esb-distribution/ext-resources
</externalizableResourcesStageDir>
</properties>
<!-- all project modules (OSGi bundles + distribution) -->
<modules>
<module>bundle-module1</module>
<module>bundle-module2</module>
...
<module>distribution</module>
</modules>
<dependencyManagement>
<dependencies>
...
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<!--
Cleans contents of the folder where the externalized resources will be consolidated
Each module adds its own external files to the distribution directory during its own build
-->
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>clean-ext-resources</id>
<phase>clean</phase>
</execution>
</executions>
<configuration>
<filesets>
<fileset>
<directory>${externalizableResourcesStageDir}</directory>
<includes>
<include>*.*</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version>
<configuration>
<descriptors>
<descriptor>src/assemble/assembly.xml</descriptor>
</descriptors>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
NOTE: We've also made sure that the externalized resource files are excluded from being packaged inside the individual bundle JARs (see the resources section of the module POM.) The resulting unzipped distribution will look like this:
my-app-distribution
/bundles
module1-bundle.jar
module2-bundle.jar
etc.
/conf
external1.properties
external2.properties
etc.