You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by dev dev <gu...@gmail.com> on 2007/11/14 23:46:27 UTC

how to use profiles exclusively? (HELP!)

I have defined 2 project profiles (below) and the goal is to be able
to run in exclusively in devel or release environment (and not both).
However, when i run mvn help:active-profiles, i got the below message.
It should be just "release" and NOT both (devel and release). What did
 you do wrong, is this a bug in Maven2?

Active Profiles for Project
'com.mycompany.myproject:myproject-web:pom:1.0.0-SNAPSHOT':

The following profiles are active:

 - devel (source: pom)
 - release (source: pom)


+++++++++++++++++++++++++++++++++++++++++++++++++++

<project>
...
        <profile>
            <id>release</id>
            <properties>
                  <environment.type>release</environment.type>
            </properties>
            <activation>
                 <property>
                      <name>environment.type</name>
                      <value>release</value>
                 </property>
            </activation>
        </profile>

        <profile>
            <id>devel</id>
            <activation>
                 <property>
                      <name>!environment.type</name> <!--This profile
is activated when no ${environment.type} property is set. -->
                 </property>
            </activation>
        </profile>

....
</project>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: how to use profiles exclusively? (HELP!)

Posted by Wayne Fay <wa...@gmail.com>.
Try changing the dot "." in environment.type to an underscore "_".
That may do it. Not sure -- I didn't test it. Dots can sometimes cause
issues.

Wayne

On 11/14/07, dev dev <gu...@gmail.com> wrote:
> I have defined 2 project profiles (below) and the goal is to be able
> to run in exclusively in devel or release environment (and not both).
> However, when i run mvn help:active-profiles, i got the below message.
> It should be just "release" and NOT both (devel and release). What did
>  you do wrong, is this a bug in Maven2?
>
> Active Profiles for Project
> 'com.mycompany.myproject:myproject-web:pom:1.0.0-SNAPSHOT':
>
> The following profiles are active:
>
>  - devel (source: pom)
>  - release (source: pom)
>
>
> +++++++++++++++++++++++++++++++++++++++++++++++++++
>
> <project>
> ...
>        <profile>
>            <id>release</id>
>            <properties>
>                  <environment.type>release</environment.type>
>            </properties>
>            <activation>
>                 <property>
>                      <name>environment.type</name>
>                      <value>release</value>
>                 </property>
>            </activation>
>        </profile>
>
>        <profile>
>            <id>devel</id>
>            <activation>
>                 <property>
>                      <name>!environment.type</name> <!--This profile
> is activated when no ${environment.type} property is set. -->
>                 </property>
>            </activation>
>        </profile>
>
> ....
> </project>
>
> ---------------------------------------------------------------------
> 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


RE: how to use profiles exclusively? (HELP!)

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
Set one profile to have the <activeByDefault>true</...> and when you activate the other, the default one gets deactivated automatically.

-----Original Message-----
From: Roland Asmann [mailto:Roland.Asmann@cfc.at] 
Sent: Thursday, November 15, 2007 12:03 PM
To: Maven Users List
Subject: Re: how to use profiles exclusively? (HELP!)

You activate the release-profile yourself by setting the property to the 
expected value!

Remove the <properties>-tag from the profile and everything should work just 
fine!


On Wednesday 14 November 2007 23:46, dev dev wrote:
> I have defined 2 project profiles (below) and the goal is to be able
> to run in exclusively in devel or release environment (and not both).
> However, when i run mvn help:active-profiles, i got the below message.
> It should be just "release" and NOT both (devel and release). What did
>  you do wrong, is this a bug in Maven2?
>
> Active Profiles for Project
> 'com.mycompany.myproject:myproject-web:pom:1.0.0-SNAPSHOT':
>
> The following profiles are active:
>
>  - devel (source: pom)
>  - release (source: pom)
>
>
> +++++++++++++++++++++++++++++++++++++++++++++++++++
>
> <project>
> ...
>         <profile>
>             <id>release</id>
>             <properties>
>                   <environment.type>release</environment.type>
>             </properties>
>             <activation>
>                  <property>
>                       <name>environment.type</name>
>                       <value>release</value>
>                  </property>
>             </activation>
>         </profile>
>
>         <profile>
>             <id>devel</id>
>             <activation>
>                  <property>
>                       <name>!environment.type</name> <!--This profile
> is activated when no ${environment.type} property is set. -->
>                  </property>
>             </activation>
>         </profile>
>
> ....
> </project>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org

-- 
Roland Asmann

CFC Informationssysteme Entwicklungsgesellschaft m.b.H
Bäckerstrasse 1/2/7
A-1010 Wien
FN 266155f, Handelsgericht Wien

Tel.: +43/1/513 88 77 - 27
Fax.: +43/1/513 88 62
Email: Roland.Asmann@cfc.at
Web: www.cfc.at

---------------------------------------------------------------------
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


Re: how to use profiles exclusively? (HELP!)

Posted by Roland Asmann <Ro...@cfc.at>.
You activate the release-profile yourself by setting the property to the 
expected value!

Remove the <properties>-tag from the profile and everything should work just 
fine!


On Wednesday 14 November 2007 23:46, dev dev wrote:
> I have defined 2 project profiles (below) and the goal is to be able
> to run in exclusively in devel or release environment (and not both).
> However, when i run mvn help:active-profiles, i got the below message.
> It should be just "release" and NOT both (devel and release). What did
>  you do wrong, is this a bug in Maven2?
>
> Active Profiles for Project
> 'com.mycompany.myproject:myproject-web:pom:1.0.0-SNAPSHOT':
>
> The following profiles are active:
>
>  - devel (source: pom)
>  - release (source: pom)
>
>
> +++++++++++++++++++++++++++++++++++++++++++++++++++
>
> <project>
> ...
>         <profile>
>             <id>release</id>
>             <properties>
>                   <environment.type>release</environment.type>
>             </properties>
>             <activation>
>                  <property>
>                       <name>environment.type</name>
>                       <value>release</value>
>                  </property>
>             </activation>
>         </profile>
>
>         <profile>
>             <id>devel</id>
>             <activation>
>                  <property>
>                       <name>!environment.type</name> <!--This profile
> is activated when no ${environment.type} property is set. -->
>                  </property>
>             </activation>
>         </profile>
>
> ....
> </project>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org

-- 
Roland Asmann

CFC Informationssysteme Entwicklungsgesellschaft m.b.H
Bäckerstrasse 1/2/7
A-1010 Wien
FN 266155f, Handelsgericht Wien

Tel.: +43/1/513 88 77 - 27
Fax.: +43/1/513 88 62
Email: Roland.Asmann@cfc.at
Web: www.cfc.at

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org