I think this is *almost* right, and should work like a champ, though I haven't ever tried it either.

What you'll need to do is have a project that looks like this:

my-assembly-descriptor
|
+- pom.xml
|
+- src
    |
    +- main
        |
        +- resources
            |
            +- assemblies
                |
                +- my-assembly.xml


The pom will look just like any other normal 'jar' packaging pom. The my-assembly.xml file will be a normal assembly descriptor.

Now, to use it, you'll need to add this new artifact as a plugin- level dependency in your main prjoect's pom.xml, like this:


<project>
  [...]

  <build>
    <plugins>
      [...]

      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>

        <dependencies>
          <dependency>
            <groupId>org.myproject.assemblies</groupId>
            <artifactId>my-assembly-descriptor</artifactId>
            <version>1.0</version>
          </dependency>
        </dependencies>

        [...]
      </plugin>
    </plugins>
  </build>
</project>


I think you've got a good idea, Tim, and I think these minor tweaks will make it work.

Good luck, Adam.

-john


On Aug 10, 2007, at 3:37 AM, Tim Kettler wrote:

Hi,

-- Beware: Untested Instructions --  :-)

I.
Create a new project, put the assembly descriptors you want to have available across projects in 'src/resources/assemblies' and install/ deploy the artifact to your local/internal repository.

II.
In your projects configure the plugin like this:

  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-assembly-plugin</artifactId>
    <dependencies>
      <dependency>
        <!-- artifact containing the descriptors -->
      </dependency>
    </dependencies>
    <configuration>
      <descriptorRefs>
        <descriptorRef>name-of-your-descriptor</descriptorRef>
      </descriptorRefs>
    </configuration>
  </plugin>

-Tim

Adam schrieb:
Hey all, question about the assembly plugin.
Is there a way to specify one assembly.xml descriptor within a POM
that is global to all projects and to have it inherit down to all
sub-projects?  Right now when I run the execution phase the assembly
is tied to from a sub-project of a parent project (that is in turn a
child to the global POM) I get an error saying it can not locate the
descriptor. I would like to only have one descriptor for all projects and have it in the master parent POM. That way I can specify a global
execution phase so all sources get added into each project every time
they are built but, I only want ZIP files, not TAR and tarball as in
the default.
Thanks in advance,
Adam
[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]


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


Reply via email to