Maven 2.x Assembly Plugin

[assembly plugin] improve or clarify inheriting/reusing descriptors

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 2.2-beta-3
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

Description

I want to declare a new reusable assembly descriptor. Then, in my parent pom I can reference that descriptor, and all children projects will be able to do assembly:assembly without specifying the descriptor. This actually works halfway, but then the assembly plugin can't find the descriptor - because it doesn't live inside of the child project. I was trying to play around with putting the descriptor in the parent project, but since the packaging has to be "pom" that of course wouldn't work.

Unless I misunderstand, the way this currently works, I'd have to declare the descriptor for each and every child project. Which would be very unfortunate, since the 3 supplied predefined descriptors don't meet my needs.

If there is a way to do this, then the improvement request is to improve the documentation for this since I couldn't figure it out...

Issue Links

Activity

Hide
MMA added a comment -

Hi,

I am looking for the same feature actually.

For plugin site, there is a goal site:attach-descriptor that "adds the site descriptor to the list of files to be installed/deployed". This goal is called when intalling/deploying.
Wouldn't we need the same kind of goal for assembly plugin ?

Show
MMA added a comment - Hi, I am looking for the same feature actually. For plugin site, there is a goal site:attach-descriptor that "adds the site descriptor to the list of files to be installed/deployed". This goal is called when intalling/deploying. Wouldn't we need the same kind of goal for assembly plugin ?
Hide
Grégory Joseph added a comment - - edited

Solution described in MASSEMBLY-73 works nicely !

Show
Grégory Joseph added a comment - - edited Solution described in MASSEMBLY-73 works nicely !
Hide
Joerg Schaible added a comment -

... but maven-assembly-artifact-types has not been released with 2.2-beta-2. Note that this seems pure oversight. The tagged version of the maven-assembly-plugin-2.2-beta-2 contains the sub module for maven-assembly-artifact-types which declares its version still as 2.2-beta-2-SNAPSHOT (and so does trunk)!

Show
Joerg Schaible added a comment - ... but maven-assembly-artifact-types has not been released with 2.2-beta-2. Note that this seems pure oversight. The tagged version of the maven-assembly-plugin-2.2-beta-2 contains the sub module for maven-assembly-artifact-types which declares its version still as 2.2-beta-2-SNAPSHOT (and so does trunk)!
Hide
Grégory Joseph added a comment -

I second that. Had to keep my home-built snapshot for that :/

Show
Grégory Joseph added a comment - I second that. Had to keep my home-built snapshot for that :/
Hide
John Casey added a comment -

This is a documentation issue. Actually, the simplest way to solve the problem is to create a project to house your new assembly descriptor, where that descriptor might be called 'myassembly.xml'. It should live in the following directory structure within your assembly-descriptor project:

src/main/resources/assemblies/myassembly.xml

Then, you can build/release/deploy this project, and reference it from the projects in which you want to create an assembly of this new type, using:

<plugin>
  <artifactId>maven-assembly-plugin</artifactId>
  <version>2.2-beta-2</version>
  <dependencies>
    <dependency>
      <groupId>your.group.id</groupId>
      <artifactId>my-assembly-descriptor</artifactId>
      <version>blah</version>
    </dependency>
  </dependencies>
  [...]
</plugin>

I just need to document this on the plugin website.

Show
John Casey added a comment - This is a documentation issue. Actually, the simplest way to solve the problem is to create a project to house your new assembly descriptor, where that descriptor might be called 'myassembly.xml'. It should live in the following directory structure within your assembly-descriptor project:
src/main/resources/assemblies/myassembly.xml
Then, you can build/release/deploy this project, and reference it from the projects in which you want to create an assembly of this new type, using:
<plugin>
  <artifactId>maven-assembly-plugin</artifactId>
  <version>2.2-beta-2</version>
  <dependencies>
    <dependency>
      <groupId>your.group.id</groupId>
      <artifactId>my-assembly-descriptor</artifactId>
      <version>blah</version>
    </dependency>
  </dependencies>
  [...]
</plugin>
I just need to document this on the plugin website.
Hide
Dennis Lundberg added a comment -

Fixed in r710120.

Show
Dennis Lundberg added a comment - Fixed in r710120.

People

Vote (5)
Watch (6)

Dates

  • Created:
    Updated:
    Resolved: