You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Lukas Fryc <lf...@redhat.com> on 2009/12/17 11:31:41 UTC

Profile activation

Hi guys,

I'm solving issue with issue with Maven 2.1.X,

I want to activate profile when two conditions are satisfied...

- file is missing
- property containerId isn't set

I used this:

<activation>
	<activeByDefault>false</activeByDefault>
	<file>
		<missing>${demo.location}</missing>
	</file>
	<property>
		<name>containerId</name>
		<value>jboss5x</value>
	</property>
</activation>

But profile is activated when I'm trying to do

$ mvn verify -Dtest="..."

(without any parameters and that file is missing in ${project.directory})


Article 11.4 from
http://www.sonatype.com/books/maven-book/reference/profiles-sect-activation.html
says, that this is possible.
-- 
View this message in context: http://old.nabble.com/Profile-activation-tp26826008p26826008.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Profile activation

Posted by Dennis Lundberg <de...@apache.org>.
>From a recently updated
http://maven.apache.org/guides/introduction/introduction-to-profiles.html

"As of Maven 2.0.9, the tags <exists> and <missing> could be
interpolated. Supported variables are system properties like
${user.home} and enviroment variables like ${env.HOME}. Please note that
properties defined in the POM itself are not available for interpolation
here."

Is this what you are running into?

Lukas Fryc wrote:
> Hi guys,
> 
> I'm solving issue with issue with Maven 2.1.X,
> 
> I want to activate profile when two conditions are satisfied...
> 
> - file is missing
> - property containerId isn't set
> 
> I used this:
> 
> <activation>
> 	<activeByDefault>false</activeByDefault>
> 	<file>
> 		<missing>${demo.location}</missing>
> 	</file>
> 	<property>
> 		<name>containerId</name>
> 		<value>jboss5x</value>
> 	</property>
> </activation>
> 
> But profile is activated when I'm trying to do
> 
> $ mvn verify -Dtest="..."
> 
> (without any parameters and that file is missing in ${project.directory})
> 
> 
> Article 11.4 from
> http://www.sonatype.com/books/maven-book/reference/profiles-sect-activation.html
> says, that this is possible.


-- 
Dennis Lundberg

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


RE: Profile activation

Posted by Lukas Fryc <lf...@redhat.com>.
Sorry, thanks for reply, but this resolution wouldn't help me. :-)


Lukas Fryc wrote:
> 
> Thanks Martin,
> 
> I tried all of the possible combinations in property name/value, like:
> 
> <property><name>containerId</name></property>
> <property><name>!containerId</name></property>
> <property><name>containerId</name><value></value></property>
> <property><name>containerId</name><value>!</value></property>
> 
> 
> mgainty wrote:
>> 
>> 
>> i would use the not on the property's name e.g.
>> 
>>       <property>
>>         <name>!containerId</name>
>>       </property>Martin Gainty 
>> ______________________________________________ 
>> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité 
>> 
>> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
>> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede
>> unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese
>> Nachricht dient lediglich dem Austausch von Informationen und entfaltet
>> keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit
>> von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
>> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas
>> le destinataire prévu, nous te demandons avec bonté que pour satisfaire
>> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la
>> copie de ceci est interdite. Ce message sert à l'information seulement et
>> n'aura pas n'importe quel effet légalement obligatoire. Étant donné que
>> les email peuvent facilement être sujets à la manipulation, nous ne
>> pouvons accepter aucune responsabilité pour le contenu fourni.
>> 
>> 
>> 
>> 
>>> Date: Thu, 17 Dec 2009 02:31:41 -0800
>>> From: lfryc@redhat.com
>>> To: users@maven.apache.org
>>> Subject: Profile activation
>>> 
>>> 
>>> Hi guys,
>>> 
>>> I'm solving issue with issue with Maven 2.1.X,
>>> 
>>> I want to activate profile when two conditions are satisfied...
>>> 
>>> - file is missing
>>> - property containerId isn't set
>>> 
>>> I used this:
>>> 
>>> <activation>
>>> 	<activeByDefault>false</activeByDefault>
>>> 	<file>
>>> 		<missing>${demo.location}</missing>
>>> 	</file>
>>> 	<property>
>>> 		<name>containerId</name>
>>> 		<value>jboss5x</value>
>>> 	</property>
>>> </activation>
>>> 
>>> But profile is activated when I'm trying to do
>>> 
>>> $ mvn verify -Dtest="..."
>>> 
>>> (without any parameters and that file is missing in
>>> ${project.directory})
>>> 
>>> 
>>> Article 11.4 from
>>> http://www.sonatype.com/books/maven-book/reference/profiles-sect-activation.html
>>> says, that this is possible.
>>> -- 
>>> View this message in context:
>>> http://old.nabble.com/Profile-activation-tp26826008p26826008.html
>>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>> 
>>  		 	   		  
>> _________________________________________________________________
>> Hotmail: Powerful Free email with security by Microsoft.
>> http://clk.atdmt.com/GBL/go/171222986/direct/01/
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Profile-activation-tp26826008p26827348.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


RE: Profile activation

Posted by Lukas Fryc <lf...@redhat.com>.
Thanks Martin,

I tried all of the possible combinations in property name/value, like:

<property><name>containerId</name></property>
<property><name>!containerId</name></property>
<property><name>containerId</name><value></value></property>
<property><name>containerId</name><value>!</value></property>


mgainty wrote:
> 
> 
> i would use the not on the property's name e.g.
> 
>       <property>
>         <name>!containerId</name>
>       </property>Martin Gainty 
> ______________________________________________ 
> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité 
> 
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
> dient lediglich dem Austausch von Informationen und entfaltet keine
> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
> destinataire prévu, nous te demandons avec bonté que pour satisfaire
> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la
> copie de ceci est interdite. Ce message sert à l'information seulement et
> n'aura pas n'importe quel effet légalement obligatoire. Étant donné que
> les email peuvent facilement être sujets à la manipulation, nous ne
> pouvons accepter aucune responsabilité pour le contenu fourni.
> 
> 
> 
> 
>> Date: Thu, 17 Dec 2009 02:31:41 -0800
>> From: lfryc@redhat.com
>> To: users@maven.apache.org
>> Subject: Profile activation
>> 
>> 
>> Hi guys,
>> 
>> I'm solving issue with issue with Maven 2.1.X,
>> 
>> I want to activate profile when two conditions are satisfied...
>> 
>> - file is missing
>> - property containerId isn't set
>> 
>> I used this:
>> 
>> <activation>
>> 	<activeByDefault>false</activeByDefault>
>> 	<file>
>> 		<missing>${demo.location}</missing>
>> 	</file>
>> 	<property>
>> 		<name>containerId</name>
>> 		<value>jboss5x</value>
>> 	</property>
>> </activation>
>> 
>> But profile is activated when I'm trying to do
>> 
>> $ mvn verify -Dtest="..."
>> 
>> (without any parameters and that file is missing in ${project.directory})
>> 
>> 
>> Article 11.4 from
>> http://www.sonatype.com/books/maven-book/reference/profiles-sect-activation.html
>> says, that this is possible.
>> -- 
>> View this message in context:
>> http://old.nabble.com/Profile-activation-tp26826008p26826008.html
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>> 
>  		 	   		  
> _________________________________________________________________
> Hotmail: Powerful Free email with security by Microsoft.
> http://clk.atdmt.com/GBL/go/171222986/direct/01/
> 

-- 
View this message in context: http://old.nabble.com/Profile-activation-tp26826008p26827323.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


RE: Profile activation

Posted by Martin Gainty <mg...@hotmail.com>.
i would use the not on the property's name e.g.

      <property>
        <name>!containerId</name>
      </property>Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité 

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> Date: Thu, 17 Dec 2009 02:31:41 -0800
> From: lfryc@redhat.com
> To: users@maven.apache.org
> Subject: Profile activation
> 
> 
> Hi guys,
> 
> I'm solving issue with issue with Maven 2.1.X,
> 
> I want to activate profile when two conditions are satisfied...
> 
> - file is missing
> - property containerId isn't set
> 
> I used this:
> 
> <activation>
> 	<activeByDefault>false</activeByDefault>
> 	<file>
> 		<missing>${demo.location}</missing>
> 	</file>
> 	<property>
> 		<name>containerId</name>
> 		<value>jboss5x</value>
> 	</property>
> </activation>
> 
> But profile is activated when I'm trying to do
> 
> $ mvn verify -Dtest="..."
> 
> (without any parameters and that file is missing in ${project.directory})
> 
> 
> Article 11.4 from
> http://www.sonatype.com/books/maven-book/reference/profiles-sect-activation.html
> says, that this is possible.
> -- 
> View this message in context: http://old.nabble.com/Profile-activation-tp26826008p26826008.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
 		 	   		  
_________________________________________________________________
Hotmail: Powerful Free email with security by Microsoft.
http://clk.atdmt.com/GBL/go/171222986/direct/01/