Return-Path: Delivered-To: apmail-maven-issues-archive@minotaur.apache.org Received: (qmail 32073 invoked from network); 4 Jan 2010 18:42:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 Jan 2010 18:42:26 -0000 Received: (qmail 81221 invoked by uid 500); 4 Jan 2010 18:42:26 -0000 Delivered-To: apmail-maven-issues-archive@maven.apache.org Received: (qmail 81141 invoked by uid 500); 4 Jan 2010 18:42:25 -0000 Mailing-List: contact issues-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@maven.apache.org Delivered-To: mailing list issues@maven.apache.org Received: (qmail 81129 invoked by uid 99); 4 Jan 2010 18:42:25 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Jan 2010 18:42:25 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [63.246.2.115] (HELO codehaus01.managed.contegix.com) (63.246.2.115) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Jan 2010 18:42:16 +0000 Received: from codehaus01.managed.contegix.com (localhost.localdomain [127.0.0.1]) by codehaus01.managed.contegix.com (Postfix) with ESMTP id 6DDF314A825B for ; Mon, 4 Jan 2010 12:41:55 -0600 (CST) Date: Mon, 4 Jan 2010 12:41:55 -0600 (CST) From: "Dennis Lundberg (JIRA)" To: issues@maven.apache.org Message-ID: <27570505.52232.1262630515444.JavaMail.haus-jira@codehaus01.managed.contegix.com> In-Reply-To: <12336.52215.1262627815433.JavaMail.haus-jira@codehaus01.managed.contegix.com> Subject: [jira] Commented: (MNG-4516) Contradiction between the documentation and Maven's behavior related to profile-activation with multiple criteria MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 4e90ceb663894a42f12c0e28abbab431 [ http://jira.codehaus.org/browse/MNG-4516?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=205047#action_205047 ] Dennis Lundberg commented on MNG-4516: -------------------------------------- If you read this: http://maven.apache.org/guides/introduction/introduction-to-profiles.html you will see: "As of Maven 2.0.9, the tags and 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." > Contradiction between the documentation and Maven's behavior related to profile-activation with multiple criteria > ----------------------------------------------------------------------------------------------------------------- > > Key: MNG-4516 > URL: http://jira.codehaus.org/browse/MNG-4516 > Project: Maven 2 & 3 > Issue Type: Bug > Components: Profiles > Affects Versions: 2.2.1 > Reporter: Barnabas Bodnar > Priority: Critical > Attachments: debug_output.txt, 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 is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira