Hi Brian,
I think the moduleSet support was upgraded in the more recent releases,
to support other than tree-structures. My projects are *not* in a
directory tree, but are instead, "flat". The <modules> elements look
like <module>../submodule1</module>.
I built the following and tested it and it seems to work nicely. First,
I created another assembly descriptor and saved it as a loadable
resource for the assembly plugin to reference. This descriptor is
designed to work for either multi-module assemblies, or just single
projects (no <modules>):
<assembly>
<id>source-release</id> <!-- match the previous one, becomes
"classifier" -->
<formats>
<format>zip</format>
</formats>
<moduleSets>
<moduleSet>
<sources>
<outputDirectory>/</outputDirectory>
<useDefaultExcludes>true</useDefaultExcludes>
<excludes>
<!-- here, I copied all those hairy regex things from the
Apache Common Parent version -->
...
</excludes>
</sources>
</moduleSet>
</moduleSets>
<fileSets>
<!-- this gets the aggregate artifact source, or if no <modules>,
the main source, as before -->
<fileSet>
<directory>.</directory>
<outputDirectory>/${project.artifactId}</outputDirectory>
<useDefaultExcludes>true</useDefaultExcludes>
<excludes>
<!-- here, I (once again) copied all those hairy regex things
from the Apache Common Parent version -->
...
</excludes>
</fileSet>
<!-- license, readme, etc. calculated at build time -->
<fileSet>
<directory>${project.build.directory}/maven-shared-archive-resources/META-INF</directory>
<outputDirectory>/</outputDirectory>
</fileSet>
</fileSets>
</assembly>
Having that, I then overrode the Apache Common Parent POM build action
when "apache-release" is specified as a profile:
<properties>
<sourceReleaseAssemblyDescriptor>multimodule-source-release</sourceReleaseAssemblyDescriptor>
</properties>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<dependencies>
<dependency> <!-- here I stuck in the dependency on the above
saved asm descriptor -->
<groupId>org.apache.uima</groupId>
<artifactId>uima-jar-resource-bundle</artifactId>
<version>1-SNAPSHOT</version>
</dependency>
</dependencies>
</plugin>
This seems to work (at least for my project). I think it should be
considered for the common Apache Parent pom. Should I open a Jira for
this, and if so, what Jira system is being used for the Apache Parent poms?
-Marshall Schor
On 5/17/2010 5:13 PM, Brian E. Fox wrote:
> This descriptor assumes that all modules ate children of the execution
> root...or a tree. If that's not the case in your project then you
> would need to create a custom bundle descriptor.
>
> --Brian (mobile)
>
>
> On May 17, 2010, at 3:20 PM, Marshall Schor <[email protected]> wrote:
>
>> The current common apache parent POM (version 7) [1], when you specify
>> the "apache-release" profile, activates a part:
>>
>> <plugins>
>>
>> <!--
>> Create a source-release artifact that contains the fully buildable
>> project directory source structure. This is the artifact
>> which is
>> the official subject of any release vote.
>> -->
>>
>> <plugin>
>> <artifactId>maven-assembly-plugin</artifactId>
>> . . .
>> <executions>
>> <execution>
>> <id>source-release-assembly</id>
>> . . .
>> <configuration>
>> <runOnlyAtExecutionRoot>true</runOnlyAtExecutionRoot>
>> . . .
>> </configuration>
>>
>> When used on a multi-module aggregate project, this only creates the
>> source-release-assembly at the aggregate project level. It seems to me,
>> since this artifact is the "official subject of any release vote", that
>> this source assembly should include the sources from this aggregate
>> project, **** plus all of the sub-modules ****. (Currently it only has
>> the the source from this aggregate project; none of the submodules are
>> included.)
>>
>> I think the assembly plugin attempts to support this use case, via its
>> "<moduleSets>" elements. Are multi-module projects in Apache supposed
>> to override the common Apache Parent and specify the <moduleSets> form
>> of assembly?
>>
>> Or is there another preferred way to do this?
>>
>> -Marshall Schor
>>
>> [1] http://repo1.maven.org/maven2/org/apache/apache/7/apache-7.pom
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]