Hi,

 

I am using a multi-module java project with a root pom to create a zip
file with the assembly plugin. The zip file contains some 3rd party
platform-specific files (dll's for windows, dylib for mac, .so for
linux).

 

This works fine when using following instructions in the root pom:

 

          <plugin>

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

            <configuration>

              <appendAssemblyId>false</appendAssemblyId>

              <finalName>myName</finalName>

              <descriptors>

                <descriptor>assembly.xml</descriptor>

              </descriptors>

            </configuration>    

          </plugin>

 

Maven is started from command line using "mvn clean package
assembly:assembly"

 

The resulting assembly (zip file) contains all the files that are
platform specific I would like to create a specific zip file for each
target platform, containing only the files for that platform. I could
use a specific assembly.xml file for each target platform, and add this
to the descriptors.

 

              <descriptors>

                <descriptor>assemblyWin.xml</descriptor>

                <descriptor>assemblyMac.xml</descriptor>

                <descriptor>assemblyLinux.xml</descriptor>

              </descriptors>

 

This works, but I cannot specify the final name for each of the
descriptors. The 3 zip files have the same name, so only the last one is
available (the 2 other files are overwritten).

 

I tried specifying different executions for the assembly plugin, but
then I get an error that the assembly descriptors cannot be found.
Apparently this does not work in the root pom of a multi-module project.

[INFO]
------------------------------------------------------------------------

[ERROR] BUILD ERROR

[INFO]
------------------------------------------------------------------------

[INFO] Error reading assemblies: No assembly descriptors found.

 

          <plugin>

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

            <executions>

              <execution>

                <id>win</id>

                <configuration>

                  <appendAssemblyId>false</appendAssemblyId>

                  <finalName>myNameWin</finalName>

                  <descriptors>

                    <descriptor>assemblyWin.xml</descriptor>

                  </descriptors>

                </configuration>    

              </execution>

              <execution>

                <id>mac</id>

                <configuration>

                  <appendAssemblyId>false</appendAssemblyId>

                  <finalName>myNameMac</finalName>

                  <descriptors>

                    <descriptor>assemblyMac.xml</descriptor>

                  </descriptors>

                </configuration>    

              </execution>

            </executions>

          </plugin>

 

Is there any possibility to have different zip file assemblies without
having to create different root pom's, so I don't need to recompile the
different packages over and over again?

 

Thanks,

 

Jan

 



DISCLAIMER:
Unless indicated otherwise, the information contained in this message is 
privileged and confidential, and is intended only for the use of the 
addressee(s) named above and others who have been specifically authorized to 
receive it. If you are not the intended recipient, you are hereby notified that 
any dissemination, distribution or copying of this message and/or attachments 
is strictly prohibited. The company accepts no liability for any damage caused 
by any virus transmitted by this email. Furthermore, the company does not 
warrant a proper and complete transmission of this information, nor does it 
accept liability for any delays. If you have received this message in error, 
please contact the sender and delete the message. Thank you.

Reply via email to