You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Yann Albou <ya...@club-internet.fr> on 2006/12/02 18:13:11 UTC

assembly file and descriptorRefs

I have created my own assembly.xml file.
Now I would like to make this file available through the maven repository.
Is this possible ?

I saw I can configure a descriptorRefs, but it seems limited to 
predefined assembly files (bin, jar-with-dependencies, or src).
I would like to add my own descriptorRef and make it availables to other 
projects.
When looking inside assembly source code, ref are loading using :
	getClass().getResourceAsStream( "/assemblies/" + ref + ".xml" );
So it seems that "/assemblies/myOwnRef" need to be in the classloader of 
the assembly plugin.
But how can I do it ?


Yann.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: assembly file and descriptorRefs

Posted by Yann Albou <ya...@club-internet.fr>.
Done, I added a section "How to create your own predefine assembly"

Yann.

Wendy Smoak wrote:
> On 12/3/06, Yann Albou <ya...@club-internet.fr> wrote:
> 
>> I think this tips should be in the assembly plugin documentation.
> 
> Each plugin has a page on the wiki where we encourage users to
> contribute examples.  It would be great if you could add this example
> to the Assembly plugin's page:
> 
>   http://docs.codehaus.org/display/MAVENUSER/Assembly+Plugin
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: assembly file and descriptorRefs

Posted by Wendy Smoak <ws...@gmail.com>.
On 12/3/06, Yann Albou <ya...@club-internet.fr> wrote:

> I think this tips should be in the assembly plugin documentation.

Each plugin has a page on the wiki where we encourage users to
contribute examples.  It would be great if you could add this example
to the Assembly plugin's page:

   http://docs.codehaus.org/display/MAVENUSER/Assembly+Plugin

-- 
Wendy

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: assembly file and descriptorRefs

Posted by Yann Albou <ya...@club-internet.fr>.
Thanks Wendy it was very helpful.

You're right it is working with the extensions tag. But I found another 
solution: use the <dependencies> tag inside the plugin:

I think this tips should be in the assembly plugin documentation.
Here is how I did:

<project ...>
         <artifactId>myAssemblies</artifactId>
         <groupId>com.mycompany.mygroup</groupId>
         <version>1.0.0</version>
         <packaging>jar</packaging>
</project>

Your project just need to contain the assambly descriptor file (the 
directory "assemblies" is required):
         src\main\resources\assemblies\my-distribution.xml
In this project be sure to disable filtering on resources folder 
otherwise variables like ${artifactId} will be replaced....

Then in a pom parent  (my-pom-parent) you need to declare the assembly 
configuration:

<build>
  <pluginManagement>
   <plugins>
    <plugin>
     <artifactId>maven-assembly-plugin</artifactId>
      <configuration>
       <descriptorRefs>
        <descriptorRef>my-distribution</descriptorRef>
       </descriptorRefs>
      </configuration>
      <executions>
       <execution>
        <id>my-assembly</id>
        <phase>package</phase>
        <goals>
         <goal>assembly</goal>
        </goals>
       </execution>
      </executions>
      <dependencies>
       <dependency>
        <groupId>com.mycompany.mygroup</groupId>
        <artifactId>myAssemblies</artifactId>
        <version>1.0.0</version>
       </dependency>
      </dependencies>
     </plugin>
    </plugins>
   </pluginManagement>
</build>


And Then in your project (that inherite from the "my-pom-parent") you 
just need to declare the usage of the assembly plugin:

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

Of course you can overwrite default plugin configuration.

Hope it will help other people.
Yann.



Wendy Smoak wrote:
> On 12/2/06, Yann Albou <ya...@club-internet.fr> wrote:
> 
>> I saw I can configure a descriptorRefs, but it seems limited to
>> predefined assembly files (bin, jar-with-dependencies, or src).
>> I would like to add my own descriptorRef and make it availables to other
>> projects.
> 
> Maybe as a build extension?  Try creating another module and putting
> your assembly descriptor in a jar.  Deploy that to your Maven repo,
> then pull it in with <build><extensions><extension>.
> 
> I haven't tried it with assembly, but it works for Checkstyle config files.
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: assembly file and descriptorRefs

Posted by Wendy Smoak <ws...@gmail.com>.
On 12/2/06, Yann Albou <ya...@club-internet.fr> wrote:

> I saw I can configure a descriptorRefs, but it seems limited to
> predefined assembly files (bin, jar-with-dependencies, or src).
> I would like to add my own descriptorRef and make it availables to other
> projects.

Maybe as a build extension?  Try creating another module and putting
your assembly descriptor in a jar.  Deploy that to your Maven repo,
then pull it in with <build><extensions><extension>.

I haven't tried it with assembly, but it works for Checkstyle config files.

-- 
Wendy

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org