maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roland Asmann <Roland.Asm...@cfc.at>
Subject Re: Aggregate profiles
Date Tue, 01 Aug 2006 07:48:02 GMT
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: 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


Mime
View raw message