That is true, but for my project I have sort of a profile pre-requisite list...
I am looking for a way to have profile A automatically activated when I
activate B, which in turn is needed when I run C.
The thing is that I do not want to build profile A into B and C, and profile
B into C, which makes my POM very long and hard to maintain (since I
have more than the 3 profiles mentioned here as an example).
With the solution I wrote below, it is at least possible to have a sort of
profile-dependency, but it only helps with 2 profiles...
Might be that I'm lazy, but I find it somewhat like the life-cycle (run
'install' and all previous phases are run as well) and therefor would like
to see something like this implemented or at least explained as how
this might work...

Roland



On Tuesday 01 August 2006 10:24, Alexis Midon wrote:
> you can activate many profiles with -Pprofile1,profile2,profile3 etc. as
> explained in "mvn -h":
> -P,--activate-profiles        Comma-delimited list of profiles to activate
>
> On 8/1/06, Roland Asmann <[EMAIL PROTECTED]> wrote:
> > I've been looking for something similar and found that it is possible,
> > but atm only for
> > a maximum of 2 profiles.
> > Use the property-activation for your profiles and activate 'p6spy' when
> > the property
> > is set. Then activate one of the other profiles when this property is set
> > to a specific
> > value:
> >
> > <profile>
> >         <id>p6spy</id>
> >         <activation>
> >                 <property>
> >                         <name>db</name>
> >                 </property>
> >         </activation>
> >         ........
> > </profile>
> > <profile>
> >         <id>hsql</id>
> >         <activation>
> >                 <property>
> >                         <name>db</name>
> >                         <value>hsql</value>
> >                 </property>
> >         </activation>
> >         ........
> > </profile>
> > <profile>
> >         <id>postgres</id>
> >         <activation>
> >                 <property>
> >                         <name>db</name>
> >                         <value>postgres</value>
> >                 </property>
> >         </activation>
> >         ........
> > </profile>
> >
> > Now, if you run 'mvn -Ddb=postgres' or '-Ddb=hsql' p6spy is ALWAYS
> > activated.
> >
> > Hope this helped.
> >
> > Roland
> >
> > On Tuesday 01 August 2006 01:39, Laurie Harper wrote:
> > > Is it possible to activate multiple profiles at once, as in 'mvn
> > > -Pprofile1 -Pprofile2', and have one profile override properties in the
> > > other? I'm trying to make it easy to enable p6spy, something like
> > >
> > >    <profiles>
> > >      <profile>
> > >        <id>hsql</id>
> > >        <activation>
> > >          <activeByDefault>true</activeByDefault>
> > >        </activation>
> > >        <properties>
> > >          <databaseType>hsqldb</databaseType>
> > >          <databaseDriver>org.hsqldb.jdbcDriver</databaseDriver>
> > >          ...
> > >        </properties>
> > >      </profile>
> > >      <profile>
> > >        <id>postgres</id>
> > >        <properties>
> > >          <databaseType>postgresql</databaseType>
> > >          <databaseDriver>org.postgresql.Driver</databaseDriver>
> > >          ...
> > >        </properties>
> > >      </profile>
> > >      <profile>
> > >        <id>p6spy</id>
> > >        <properties>
> > >          <databaseDriver>...P6SpyDriver</databaseDriver>
> > >        </properties>
> > >      </profile>
> > >    </profiles>
> > >
> > > the idea being that you can switch databases with '-Ppostgres' and
> > > enable P6Spy for either database with, for example, '-Ppostgres
> >
> > -Pp6spy'.
> >
> > > Unfortunately, it seems that Maven only sets the properties defined in
> > > *one* of the two profiles. Is there a way to get both?
> > >
> > > Alternatively, is there another way to conditionally set properties in
> >
> > M2?
> >
> > > L.
> > >
> > >
> > > ---------------------------------------------------------------------
> > > 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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to