Re: profile activation on property set but !value vs property not set

2017-03-13 Thread Guillaume Boué

Hi,

platform!all

means that the profile will be active when the system property 
"platform" is not defined, or is defined with a value different than 
"all". Put another way, it is always active unless "platform" is equal 
to "all". This explains your observations, where both platform-reactor 
and default-reactor are active when the system property isn't set.


There was the JIRA MNGSITE-293, in which the documentation was clarified 
to reflect this.


Guillaume

Le 12/03/2017 à 05:00, Justin Georgeson a écrit :

Seeing that I can ! the property value in a profile activation, I assumed there 
were three states to consider when evaluating the property activation:

 1. Property not set
 2. Property set and value does not match
 3. Property set and value does match

With this assumption I thought that with profiles such as these

 
 
 default-reactor
 
!platform
 
 
 platform-reactor
 
platform!all
 
 
 all-platforms-reactor
 
platformall
 
 

I would only see one of the three profiles active at a time. However when I run 
Maven 'mvn help:active-profiles' with no 'platform' property then both the 
'default-reactor' and 'platform-reactor' are active. When I set the 'platform' 
property then I see the behavior I expected. Looking at the source

https://github.com/apache/maven/blob/38300cf2832e9a40198091aa9e0bf6d3dbc3268d/maven-model-builder/src/main/java/org/apache/maven/model/profile/activation/PropertyProfileActivator.java#L95

It's doing a string compare of the activation's declared property value against the 
context's property value, but it's not checking the context has a property set. But I 
would infer from the comment on L94 ("we have a value, so it has to match the system 
value...") that an unset property should not match a !value activation.

Should I open a JIRA issue as a bug, or as a feature request?

--
This e-mail, including any attached files, may contain confidential and 
privileged information for the sole use of the intended recipient.  Any review, 
use, distribution, or disclosure by others is strictly prohibited.  If you are 
not the intended recipient (or authorized to receive information for the 
intended recipient), please contact the sender by reply e-mail and delete all 
copies of this message.

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




---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel 
antivirus Avast.
https://www.avast.com/antivirus


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



profile activation on property set but !value vs property not set

2017-03-11 Thread Justin Georgeson
Seeing that I can ! the property value in a profile activation, I assumed there 
were three states to consider when evaluating the property activation:

1. Property not set
2. Property set and value does not match
3. Property set and value does match

With this assumption I thought that with profiles such as these



default-reactor
!platform


platform-reactor

platform!all


all-platforms-reactor

platformall



I would only see one of the three profiles active at a time. However when I run 
Maven 'mvn help:active-profiles' with no 'platform' property then both the 
'default-reactor' and 'platform-reactor' are active. When I set the 'platform' 
property then I see the behavior I expected. Looking at the source

https://github.com/apache/maven/blob/38300cf2832e9a40198091aa9e0bf6d3dbc3268d/maven-model-builder/src/main/java/org/apache/maven/model/profile/activation/PropertyProfileActivator.java#L95

It's doing a string compare of the activation's declared property value against 
the context's property value, but it's not checking the context has a property 
set. But I would infer from the comment on L94 ("we have a value, so it has to 
match the system value...") that an unset property should not match a !value 
activation.

Should I open a JIRA issue as a bug, or as a feature request?

--
This e-mail, including any attached files, may contain confidential and 
privileged information for the sole use of the intended recipient.  Any review, 
use, distribution, or disclosure by others is strictly prohibited.  If you are 
not the intended recipient (or authorized to receive information for the 
intended recipient), please contact the sender by reply e-mail and delete all 
copies of this message.

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