[EMAIL PROTECTED] wrote:
> Hi,
>
> i am struggeling with profiles and resources.
>
> I have
> src/main/resources/application.properties
> src/main/dev-resources/application.properties
>
> my profiles in pom.xml
>
> <profiles>
> <profile>
> <id>production</id>
> <activation>
> <activeByDefault>true</activeByDefault>
> </activation>
> <properties>
> <env>production</env>
> </properties>
> </profile>
> <profile>
> <id>development</id>
> <activation>
> <property>
> <name>env</name>
> <value>development</value>
> </property>
> </activation>
[snip]
This does simply not work. The active profiles (all of them!) are chosen before
any of the defined properties within the profile section is assigned. So it is
not a problem of sequence, it simply does not work this way.
Such a case is typically handled by using an unset property for the default
profile:
<profile>
<id>production</id>
<activation>
<property>
<name>!env</name>
</property>
</activation>
<!-- This is the default now -->
</profile>
<profile>
<id>development</id>
<activation>
<property>
<name>env</name>
<value>development</value>
</property>
</activation>
<!-- This can be activated from command line by setting
-Denv=development -->
</profile>
- Jörg
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]