You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Usman Chaudhry <us...@redmath.com> on 2007/11/08 09:25:08 UTC

Multiple Profiles build in one go

Hi,

I have setup a maven project with a jar file as an artifact. I am also 
using assembly plugin to assemble my shipments which include not only 
jar built also some other artifacts like readme, release notes and some 
configuration files. I have created three profiles for my three 
different enviornments i.e CIT, ST and PR. Each profile has a different 
set of configuration values which I was able to achieve with filters.

Now the problem where I am stuck is that, for some reason, I need to 
generate 3 jar files (for 3 different environments) in one go and then 
assemble them in one shipment. Ideally I would like to have another 
profile named "ALL_ENVIRONMENTS" which somehow should invoke 
build/package process for rest of the individual profiles to generate 3 
jars with different configuration.

My shipment folder should look like this:

-Shipment
--CIT
---jar file
---config files
--ST
---jar file
---config files
--PR
---jar file
---config files
--some instruction documents.

I would like to generate this assembly and all the artifacts with one 
maven assembly command from command line. Is this possible? Can someone 
advise on this?

Regards,
Usman Chaudhry


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


Re: Multiple Profiles build in one go

Posted by Wayne Fay <wa...@gmail.com>.
I don't know if this is possible. Why do you need to generate all 3 in
one run? Just for ease of use/convenience or some other reason?

Wayne

On 11/8/07, Usman Chaudhry <us...@redmath.com> wrote:
> Hi,
>
> I have setup a maven project with a jar file as an artifact. I am also
> using assembly plugin to assemble my shipments which include not only
> jar built also some other artifacts like readme, release notes and some
> configuration files. I have created three profiles for my three
> different enviornments i.e CIT, ST and PR. Each profile has a different
> set of configuration values which I was able to achieve with filters.
>
> Now the problem where I am stuck is that, for some reason, I need to
> generate 3 jar files (for 3 different environments) in one go and then
> assemble them in one shipment. Ideally I would like to have another
> profile named "ALL_ENVIRONMENTS" which somehow should invoke
> build/package process for rest of the individual profiles to generate 3
> jars with different configuration.
>
> My shipment folder should look like this:
>
> -Shipment
> --CIT
> ---jar file
> ---config files
> --ST
> ---jar file
> ---config files
> --PR
> ---jar file
> ---config files
> --some instruction documents.
>
> I would like to generate this assembly and all the artifacts with one
> maven assembly command from command line. Is this possible? Can someone
> advise on this?
>
> Regards,
> Usman Chaudhry
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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


Re: Multiple Profiles build in one go

Posted by Dave Feltenberger <da...@gmail.com>.
Maybe you could write a shell script to do this for you?  This is sort
of a hack, but I don't know of any clean way to do it using Maven.  I
have a similar problem with client-specific properties included in one
of the projects and the filtering done by a profile/command argument.
To build all of them I do something like this in a bash script:

for n in "profile1,profile2,profile3,etc.";
do
   mvn clean package -Dprofile=$n -f project/pom.xml;
   # copy project/target/artifact.jar to some temporary directory, e.g.:
   copy project/target/artifact.jar tempDir/$n/
done;

# assemble your final tar/zip for shipment
tar cf final.tar tempDir


On Nov 8, 2007 3:25 AM, Usman Chaudhry <us...@redmath.com> wrote:
> Hi,
>
> I have setup a maven project with a jar file as an artifact. I am also
> using assembly plugin to assemble my shipments which include not only
> jar built also some other artifacts like readme, release notes and some
> configuration files. I have created three profiles for my three
> different enviornments i.e CIT, ST and PR. Each profile has a different
> set of configuration values which I was able to achieve with filters.
>
> Now the problem where I am stuck is that, for some reason, I need to
> generate 3 jar files (for 3 different environments) in one go and then
> assemble them in one shipment. Ideally I would like to have another
> profile named "ALL_ENVIRONMENTS" which somehow should invoke
> build/package process for rest of the individual profiles to generate 3
> jars with different configuration.
>
> My shipment folder should look like this:
>
> -Shipment
> --CIT
> ---jar file
> ---config files
> --ST
> ---jar file
> ---config files
> --PR
> ---jar file
> ---config files
> --some instruction documents.
>
> I would like to generate this assembly and all the artifacts with one
> maven assembly command from command line. Is this possible? Can someone
> advise on this?
>
> Regards,
> Usman Chaudhry
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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