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]


Reply via email to