maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karl Heinz Marbaise (JIRA)" <>
Subject [jira] (MASSEMBLY-649) Assembly descriptor needs <sourceBinaries> (or similar) to go with <binaries> and <sources>
Date Sat, 01 Mar 2014 17:02:59 GMT


Karl Heinz Marbaise commented on MASSEMBLY-649:

With maven-assembly-plugin:2.4 this can be solved simpler with the following descriptor (which
is not perfect and can be improved):
<assembly xmlns=""

Unfortunately you have to define exclude rules for those modules which don't have attached
sources packages. But no need to go via fileSet.

> Assembly descriptor needs <sourceBinaries> (or similar) to go with <binaries>
and <sources>
> -------------------------------------------------------------------------------------------
>                 Key: MASSEMBLY-649
>                 URL:
>             Project: Maven Assembly Plugin
>          Issue Type: Improvement
>            Reporter: Nicholas Williams
> Consider the following project structure:
> {noformat}
> - parent
>    - pom.xml
>    - assembly
>       - pom.xml
>    - module1
>       - pom.xml
>    - module2
>       - pom.xml
>    - module3
>       - pom.xml
> {noformat}
> As recommended [here|],
the "assembly" sub-project exists to run the assembly plugin during package phase and depends
on module1, module2, and module3 to achieve this.
> Using {{<moduleSet>/<binaries>}} I can include all of the compiled binaries
from module1, module2, and module3 in the assembly. Using {{<moduleSet>/<sources>}}
I can likewise include all of the sources, but the problem is that {{<sources>}} actually
includes the entire source directories including POM and project files for each module, which
is not always desired.
> Modules 1-3 in this case use the maven-source-plugin to create source binaries ([artifactId]-[version]-sources.jar).
I want to include those source JARs in the assembly. However, I cannot do this with {{<moduleSet>}}
or with {{<dependencySet>}}. I have to add a {{<fileSet>}} for each module's lone
source JAR, like so:
> {code:xml}
>     <fileSet>
>         <directory>../module1/target</directory>
>         <includes><include>*-sources.jar</include></includes>
>         <outputDirectory>/sources</outputDirectory>
>     </fileSet>
>     <fileSet>
>         <directory>../module2/target</directory>
>         <includes><include>*-sources.jar</include></includes>
>         <outputDirectory>/sources</outputDirectory>
>     </fileSet>
>     <fileSet>
>         <directory>../module3/target</directory>
>         <includes><include>*-sources.jar</include></includes>
>         <outputDirectory>/sources</outputDirectory>
>     </fileSet>
> {code}
> This gets tedious with many modules (and really shouldn't be necessary). We either need
a {{<sourceBinaries>}} option that works similarly to {{<binaries>}} except on
source JARs, or {{<binaries>}} needs to be changed to optionally support source JARs.

This message was sent by Atlassian JIRA

View raw message