You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Andy Thompson <ar...@gmail.com> on 2007/03/05 19:24:58 UTC

odd question

i've run into a situation where i've got a set of jars that are identical
except for a set of properties files.

what i would like to do is have a set of profiles that inserts the relevent
properties files into the jar.  And this isn't a problem.  But i would also
like to automate that process where the build creates a jar for each
profile.  for example, in the parent pom.xml - i'd like it to run
mvn compile -DsomeProfile=bob
mvn compile -DsomeProfile=sally

and generate sally.jar and bob.jar.

thoughts on how to approach this?

-- 
Andrew R. Thompson
Currently in D.C. Consulting

Re: odd question

Posted by Wayne Fay <wa...@gmail.com>.
Except that I believe he actually would like to construct builds for
multiple classifiers "in a single pass".

I think the profiles + classifiers + a batch file to run Mvn multiple
times with various profiles activated is the best way to do this.

Wayne

On 3/5/07, Eric Redmond <er...@gmail.com> wrote:
> This is what classifiers are for:
>
> <project>
> <build>
> <plugin>
>  <artifactId>maven-jar-plugin</artifactId>
>  <configuration>
>   <classifier>${myClassifier}</classifier>
>  </configuration>
>
> ... then for each profile:
>
> <profiles>
>  <profile>
>    <id>profile1</id>
>    <properties>
>      <myClassifier>profile1</myClassifier>
>    </properties>
>
> Viola
>
> Eric
>
> On 3/5/07, Andy Thompson <ar...@gmail.com> wrote:
> >
> > i've run into a situation where i've got a set of jars that are identical
> > except for a set of properties files.
> >
> > what i would like to do is have a set of profiles that inserts the
> > relevent
> > properties files into the jar.  And this isn't a problem.  But i would
> > also
> > like to automate that process where the build creates a jar for each
> > profile.  for example, in the parent pom.xml - i'd like it to run
> > mvn compile -DsomeProfile=bob
> > mvn compile -DsomeProfile=sally
> >
> > and generate sally.jar and bob.jar.
> >
> > thoughts on how to approach this?
> >
> > --
> > Andrew R. Thompson
> > Currently in D.C. Consulting
> >
>
>
>
> --
> Eric Redmond
> http://codehaus.org/~eredmond
>

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


Re: odd question

Posted by Eric Redmond <er...@gmail.com>.
This is what classifiers are for:

<project>
<build>
<plugin>
  <artifactId>maven-jar-plugin</artifactId>
  <configuration>
   <classifier>${myClassifier}</classifier>
  </configuration>

... then for each profile:

<profiles>
  <profile>
    <id>profile1</id>
    <properties>
      <myClassifier>profile1</myClassifier>
    </properties>

Viola

Eric

On 3/5/07, Andy Thompson <ar...@gmail.com> wrote:
>
> i've run into a situation where i've got a set of jars that are identical
> except for a set of properties files.
>
> what i would like to do is have a set of profiles that inserts the
> relevent
> properties files into the jar.  And this isn't a problem.  But i would
> also
> like to automate that process where the build creates a jar for each
> profile.  for example, in the parent pom.xml - i'd like it to run
> mvn compile -DsomeProfile=bob
> mvn compile -DsomeProfile=sally
>
> and generate sally.jar and bob.jar.
>
> thoughts on how to approach this?
>
> --
> Andrew R. Thompson
> Currently in D.C. Consulting
>



-- 
Eric Redmond
http://codehaus.org/~eredmond

Re: odd question

Posted by Marc Dugger <ma...@realtybaron.com>.
How about a shell script like so:

mvn compile -DsomeProfile=bob
cp ./target/project-1.0.jar ./safedir/bob.jar
mvn compile -DsomeProfile=sally
cp ./target/project-1.0.jar ./safedir/sally.jar

-- 
Marc Dugger
marc@realtybaron.com
Y!:  realtybaronhelp
MSN: help@realtybaron.com
AIM: realtybaronhelp
===========================
Search Over 3 Million Home Listings
http://www.realtybaron.com/search
===========================


On 3/5/07, Andy Thompson <ar...@gmail.com> wrote:
> i've run into a situation where i've got a set of jars that are identical
> except for a set of properties files.
>
> what i would like to do is have a set of profiles that inserts the relevent
> properties files into the jar.  And this isn't a problem.  But i would also
> like to automate that process where the build creates a jar for each
> profile.  for example, in the parent pom.xml - i'd like it to run
> mvn compile -DsomeProfile=bob
> mvn compile -DsomeProfile=sally
>
> and generate sally.jar and bob.jar.
>
> thoughts on how to approach this?
>
> --
> Andrew R. Thompson
> Currently in D.C. Consulting
>

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


Re: odd question

Posted by Jason Stelzer <cy...@elitistbastard.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On Mar 5, 2007, at 1:24 PM, Andy Thompson wrote:

> i've run into a situation where i've got a set of jars that are  
> identical
> except for a set of properties files.
>
> what i would like to do is have a set of profiles that inserts the  
> relevent
> properties files into the jar.  And this isn't a problem.  But i  
> would also
> like to automate that process where the build creates a jar for each
> profile.  for example, in the parent pom.xml - i'd like it to run
> mvn compile -DsomeProfile=bob
> mvn compile -DsomeProfile=sally
>
> and generate sally.jar and bob.jar.
>
> thoughts on how to approach this?


We're using a combination of build time filtering and the maven-ear- 
plugin to do exactly that for creating ear files that contain the  
same code, but are built for different environments. I'd imagine that  
there's a plugin very similar you can use for jar files.


- --
J.



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (Darwin)

iD8DBQFF7Ghpvxud+cMTf5IRAgi0AJ0e5Csb0m0C490QytBHBtllR1Y21wCgpHnN
ytNRTJBFxF4phrB3H0IrJYY=
=VQHS
-----END PGP SIGNATURE-----

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