You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Eric Pabst (JIRA)" <ji...@apache.org> on 2019/03/18 19:55:00 UTC
[jira] [Commented] (MNG-4516) Contradiction between the
documentation and Maven's behavior related to profile-activation with
multiple criteria
[ https://issues.apache.org/jira/browse/MNG-4516?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16795356#comment-16795356 ]
Eric Pabst commented on MNG-4516:
---------------------------------
[https://cwiki.apache.org/confluence/display/MAVEN/The+Great+JIRA+Cleanup+of+2014] shows
h1. Service Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
> Contradiction between the documentation and Maven's behavior related to profile-activation with multiple criteria
> -----------------------------------------------------------------------------------------------------------------
>
> Key: MNG-4516
> URL: https://issues.apache.org/jira/browse/MNG-4516
> Project: Maven
> Issue Type: Bug
> Components: Profiles
> Affects Versions: 2.2.1
> Reporter: Barnabas Bodnar
> Priority: Critical
> Attachments: debug_output.txt, example2.zip, output.txt, pom.xml
>
>
> The chapter 5.3.1 of the Maven Complete Reference (edition 0.2.1, Novemeber 2009) speaks unambiguously about considering a logical "AND" between more activation-conditions of a profile (cit.: "A profile is activated when all activation criteria has been satisfied. For example, a profile could list an Operating System family of Windows, and a JDK version of 1.4, this profile will only be activated when the build is executed on a Windows machine running Java 1.4.").
> Suprisingly, Maven's real behavior suggests, that the logical "OR" operator is used. The attached demo project contains a profile with two activation-criteria: a property and the existence of a file. As the output shows (attachement output.txt), the fulfillment of a single criterion is enough for activating the profile. Also the corresponding implementation in the Maven core expresses the intention to use an "OR" logic (maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java r813685 (branch 2.2.x), line 268):
> for ( Iterator activatorIterator = activators.iterator(); activatorIterator.hasNext(); )
> {
> ProfileActivator activator = (ProfileActivator) activatorIterator.next();
> if ( activator.canDetermineActivation( profile ) )
> {
> if ( activator.isActive( profile ) )
> {
> return true;
> }
> }
> }
> return false;
> As I'm considering the documentation's variant more reasonable, I'm reporting this as a bug instead of a documentation-issue.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)