You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Ephemeris Lappis <ep...@gmail.com> on 2007/04/03 09:32:50 UTC

[MAVEN][2.0.x] Generate multiple artifacts and assemblies for different targetted platforms

Hello.

 

I'm not sure profiles are exactly what I need. I'd like to build with a
single set of pom.xml (for several modules), and in a single run, all the
artifacts of a project. A typical project is a JEE application set, with
several EARs, each of them holding one or more WARs and EJB-JARs, and all of
them referencing different JARs, etc. At the end of the build process, as we
do with our Ant scripts, the full delivery set must be prepared to make a CD
on one hand, and copied to a FTP distribution server, on the other hand.

 

Each of the JEE assemblies (WARs, EJBs, EARs) may support variable
descriptors according to the needs of distinct target platforms : local
tests, customer's business or performance tests, production, etc. And to
avoid human delivery errors (yes, this may happen.), any archive name must
clearly express the targeted platform. For example, in an EAR that targets a
'test' platform, the WARs or EJB-JARs file names contain the word 'test',
the application.xml web modules or web.xml EJB references descriptors are
adapted to point to the right artifacts, etc.

 

I've thought profile could help me, but it seems they don't !...

In one run, only one profile is selected. Someone must be aware of the
delivery process and run Maven again for each the target.

I've tried changing the "finalName" for simple JAR modules for each profile,
but I've not find an easy way to build the resulting compound assemblies
(WARs, EARs) that seem to use the 'natural' jar name as it appears in the
repositories.

Adapting descriptors is also very tedious : it needs the same Ant scripting
as if using it alone. With Ant, for example to avoid multiple similar
descriptors copies, we use the Xml-Ant tasks to dynamically change a base
descriptor's parts that depend on a variable environment, and generate, then
assemble it for each target.

 

This way, it seems Maven just helps me to build simple JARs, and I have to
Ant-script all the more complex parts of the build.

 

I'm sure I'm not going the right way !

Can anyone give me a better way to start working with these assembly
processes ?

 

Thanks.

 

--

Ephemeris Lappis