[ 
http://jira.codehaus.org/browse/MASSEMBLY-73?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=146717#action_146717
 ] 

John Casey commented on MASSEMBLY-73:
-------------------------------------

There's a much simpler way to accomplish all this. In fact, I've even moved 
away from using the descriptor and component packaging types in favor of it. 
Simply put all your standardized descriptors, components, etc. into a normal 
jar project, and install that project. The project directory might look 
something like this:

{noformat}
/ my-custom-assemblies
|   +- pom.xml
|   +- src
|   |   +- main
|   |   |   +- resources
|   |   |   |   +- assemblies
|   |   |   |   |   +- custom-one.xml
|   |   |   |   |   +- custom-two.xml
{noformat}

Then, in the plugin-level dependencies of the POM from which you want to create 
an assembly (or, it could be in the top-level POM for a bunch of projects you 
want to use the same assembly...you can get pretty creative using 
pluginManagement here), you simply reference that standardized 
assembly-descriptor project:

{code:xml}
<build>
  <pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>2.2-beta-2</version>
        <dependencies>
          <dependency>
            <groupId>org.myproject</groupId>
            <artifactId>my-custom-assemblies</artifactId>
            <version>1.0</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <id>make-assembly</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <descriptorRefs>
                <descriptorRef>custom-one.xml</descriptorRef>
                <descriptorRef>custom-two.xml</descriptorRef>
              </descriptorRefs>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </pluginManagement>
</build>
{code}

Then, wherever you want a sub-module to create these two assemblies, you add 
this to the sub-module pom:

{code:xml}
<build>
  <plugins>
    <plugin>
      <artifactId>maven-assembly-plugin</artifactId>
    </plugin>
  </plugins>
</build>
{code}

> 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

        

Reply via email to