You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "John Casey (JIRA)" <ji...@codehaus.org> on 2007/07/13 21:51:13 UTC
[jira] Closed: (MASSEMBLY-73) Sharing a default assembly descriptor
across sub modules
[ http://jira.codehaus.org/browse/MASSEMBLY-73?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
John Casey closed MASSEMBLY-73.
-------------------------------
Assignee: John Casey
Resolution: Fixed
Fix Version/s: 2.2-beta-2
I just enabled this feature, with a slightly different solution. What you're really talking about is a standard assembly descriptor for more than one project. If your descriptor were built into the assembly plugin, it'd simply be a standard descriptorRef configuration. To enable this sort of behavior for standardized descriptors outside the assembly plugin itself, you can do the following:
Define a project that contains the standardized descriptor. Here's an example layout based on the integration test in:
http://svn.apache.org/repos/asf/maven/plugins/maven-assembly-plugin/src/it/basic-features/assemblyDescriptor-artifact
The pom.xml looks like this:
{code:xml}
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.test</groupId>
<artifactId>assemblyDescriptor-artifact</artifactId>
<version>1</version>
</parent>
<artifactId>descriptor</artifactId>
<packaging>assembly-descriptor</packaging>
<build>
<extensions>
<extension>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-artifact-types</artifactId>
<version>2.2-beta-2-SNAPSHOT</version>
</extension>
</extensions>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-2-SNAPSHOT</version>
</plugin>
</plugins>
</build>
</project>
{code}
The assembly descriptor is in src/main/resources/assembly-descriptor.xml by default, and looks like this in the example:
{code:xml}
<assembly>
<id>fromArtifact</id>
<formats>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<files>
<file>
<source>src/config/a/file.txt</source>
<outputDirectory>a</outputDirectory>
<filtered>true</filtered>
</file>
<file>
<source>src/config/b/file.txt</source>
<outputDirectory>b</outputDirectory>
<destName>file.txt</destName>
<filtered>true</filtered>
</file>
</files>
</assembly>
{code}
(so, pretty much normal).
You can use the standard descriptor after installing it into the repository with a pom.xml like the following:
{code:xml}
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.test</groupId>
<artifactId>assemblyDescriptor-artifact</artifactId>
<version>1</version>
</parent>
<artifactId>assembly</artifactId>
<build>
<filters>
<filter>a.properties</filter>
</filters>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-2-SNAPSHOT</version>
<configuration>
<descriptors>
<descriptor>org.test:descriptor:1</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
{code}
Note the extension in the standard descriptor's pom.xml.
> Sharing a default assembly descriptor across sub modules
> --------------------------------------------------------
>
> Key: MASSEMBLY-73
> URL: http://jira.codehaus.org/browse/MASSEMBLY-73
> Project: Maven 2.x Assembly Plugin
> Issue Type: New Feature
> Affects Versions: 2.0.1
> Reporter: vinoth rajasekaran
> Assignee: John Casey
> Fix For: 2.2-beta-2
>
>
> I have a multi-project folders setup like one shown below,
>
> root
> |_ sub-folder1
> |_ sub-folder2
> |_ sub-folder3
> |_ etc
>
> Have a root pom.xml at the root folder level and in that I have defined
> <plugin>
> <artifactId>maven-assembly-plugin</artifactId>
> <configuration>
> <descriptors>
> <descriptor>src/main/assembly/descriptor.xml
> </descriptor>
> </descriptors>
> </configuration>
> </plugin>
>
> Above descriptor works fine only if I have defined a descriptor file on the src/main/assembly folder for each sub-folder1, sub-folder2, etc.
> It would be great if maven supports me in defining a common assembly descriptor and can be shared by all the sub modules from a common location.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira