this will help
in your pom.xml enable filtering
    <directory>src/main/resources</directory>
      <filtering>true</filtering>in settings.xml establish a profile which will 
be activated by setting environment var
  <profile>
  <id>foo-development</id>
    <activation>
      <property>
        <name>!environment</name>
     </property>
    </activation>
   <properties>
   
<webserviceEndpointUrl>http://localhost:8080/services/myservice</webserviceEndpointUrl>
  </properties>
</profile>

in pom.xml setup the profile to be activated:
  <profile>
    <id>production</id>
    <activation>
      <property>
        <name>environment</name>
        <value>production</value>
      </property>
    </activation>
    <properties>
      
<webserviceEndpointUrl>http://www.acme.com/services/myservice</webserviceEndpointUrl>
    </properties>
  </profile>
  <profile>//to activate the production profile type -Denvironment=production
mvn>mvn -Denvironment=production

http://techpolesen.blogspot.com/2007/08/maven-profiles-activation-by-property.html

HTH
Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung / Note de déni et de confidentialité 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.






> From: [email protected]
> To: [email protected]
> Subject: Re: Inheriting profiles activation
> Date: Fri, 10 Apr 2009 14:44:40 +0200
> 
> I don't like to bump posts but maybe this one has been lost in the list 
> traffic.
> Anybody ?
> 
> Le lundi 06 avril 2009 17:12:33, Paul a écrit :
> > Hi,
> >
> > Using maven-2.1.0 and having a multimodules project with the following
> > layout
> >
> >
> > parent-project
> >   foo
> >     foo-api
> >     foo-flavourA
> >     foo-flavourB
> >   bar
> >     bar-api
> >     bar-flavourA
> >     bar-flavourB
> >
> > I'm trying to add profiles that allows to skip flavourA and flavourB build.
> >
> > So I added two profiles with activation nodes in the parent project and
> > tried to use theses profiles in modules foo and bar to include/exclude
> > flavour modules.
> >
> > Using mvn help:active-profiles on the parent-project show actives profiles
> > as expected but the modules declarations in modules are ignored.
> >
> > I've read that the following issue is fixed in 2.1.0 but I'm not sure it
> > covers the very same use case : http://jira.codehaus.org/browse/MNG-3228
> >
> >
> > Is this expected ? Am I doing something wrong ?
> >
> > /Paul
> >
> >
> > See pom snippets showing profiles declarations below :
> >
> >
> > parent-project pom :
> > ====================
> >
> > <profiles>
> >     <profile>
> >         <id>flavourA</id>
> >         <activation>
> >             <property>
> >                 <name>!flavourA.skip</name>
> >             </property>
> >         </activation>
> >     </profile>
> >     <profile>
> >         <id>flavourB</id>
> >         <activation>
> >             <property>
> >                 <name>!flavourB.skip</name>
> >             </property>
> >         </activation>
> >     </profile>
> > </profiles>
> >
> >
> > foo pom :
> > =========
> >
> > <profiles>
> >     <profile>
> >         <id>flavourA</id>
> >         <modules>
> >             <module>foo-flavourA</module>
> >         </modules>
> >     </profile>
> >     <profile>
> >         <id>flavourB</id>
> >         <modules>
> >             <module>foo-flavourB</module>
> >         </modules>
> >     </profile>
> > </profiles>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: [email protected]
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 

_________________________________________________________________
Rediscover Hotmail®: Get quick friend updates right in your inbox. 
http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Updates1_042009

Reply via email to