The best approach I've found for this is to create a new jar project that contains only the assembly descriptor in the directory:

src/main/resources/assemblies/your-descriptor.xml

Then, build/install this project so you have access to use the jar as a plugin-level dependency, like this:

<plugin>
  <artifactId>maven-assembly-plugin</artifactId>
  <version>2.2-beta-1</version>
  <dependencies>
    <dependency>
      <groupId>some.group.id</groupId>
      <artifactId>your-assembly-descriptors</artifactId>
      <version>1.0</version>
    </dependency>
  </dependencies>

  <executions>
    <execution>
      <id>your-assembly</id>
      <phase>package</phase>
      <goals>
<goal>single</goal> <!-- more friendly to multimodule builds than assembly:assembly or assembly:attached -->
      </goals>
      <configuration>
        <descriptorRefs>
          <descriptorRef>your-descriptor</descriptorRef>
        </descriptorRefs>
      </configuration>
    </execution>
  </executions>
</plugin>

This will allow your assembly descriptor to be available for use in multiple project builds, as above.

HTH,

-john

On Feb 28, 2008, at 3:18 PM, Benoit Decherf wrote:

Hi,

Some of our projects need to create a tgz with the same structure.
I'd like to not have to copy the assembly descriptor on all projects. Is there a way to add a new predefined descriptor ? Or how should I do that ?

Benoit

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---
John Casey
Committer and PMC Member, Apache Maven
mail: jdcasey at commonjava dot org
blog: http://www.ejlife.net/blogs/john
rss: http://feeds.feedburner.com/ejlife/john


Reply via email to