Return-Path: Delivered-To: apmail-maven-users-archive@www.apache.org Received: (qmail 62670 invoked from network); 25 Mar 2011 06:38:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 25 Mar 2011 06:38:30 -0000 Received: (qmail 29689 invoked by uid 500); 25 Mar 2011 06:38:27 -0000 Delivered-To: apmail-maven-users-archive@maven.apache.org Received: (qmail 29391 invoked by uid 500); 25 Mar 2011 06:38:25 -0000 Mailing-List: contact users-help@maven.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Maven Users List" Reply-To: "Maven Users List" Delivered-To: mailing list users@maven.apache.org Received: (qmail 29379 invoked by uid 99); 25 Mar 2011 06:38:23 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Mar 2011 06:38:23 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of gcjtmu-turbine-maven-user-846@m.gmane.org designates 80.91.229.12 as permitted sender) Received: from [80.91.229.12] (HELO lo.gmane.org) (80.91.229.12) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 25 Mar 2011 06:38:14 +0000 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Q30ed-0007lO-2w for users@maven.apache.org; Fri, 25 Mar 2011 07:37:51 +0100 Received: from mail.elsag-solutions.com ([62.154.225.82]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 25 Mar 2011 07:37:51 +0100 Received: from joerg.schaible by mail.elsag-solutions.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 25 Mar 2011 07:37:51 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: users@maven.apache.org From: =?UTF-8?B?SsO2cmc=?= Schaible Subject: Re: Maven profiles activations Followup-To: gmane.comp.jakarta.turbine.maven.user Date: Fri, 25 Mar 2011 07:37:39 +0100 Lines: 36 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: mail.elsag-solutions.com User-Agent: KNode/4.4.9 X-Virus-Checked: Checked by ClamAV on apache.org Hi Rafael, Rafael Vanderlei wrote: > Jörg, I understood when you first said that the way Maven is currently > implemented it does not work this way. > > I'm just wondering if there is a suitable reason for that. So what I still > dont understand is "if a property declared in a parent pom can be used on > the child pom for other purposes, WHY cant it be used to activate a > profile defined in that child pom?" > > Maybe it's just a matter that maven developers did not think about and > maybe could be simply implemented to work this way. On top of Benjamin's answer you have to understand *when* Maven is resolving the profiles and *when* the properties. The properties are determined from the "effective" pom for the current project i.e. the project model that is the result of merging all inherited POMs and active profiles into the final one that is used to build the project. This "effective" pom *is* what defines your project build - including the properties, because they are part of your final project definition. The profiles are used to modify this project model for alternate builds, they create a different "effective" pom i.e. the result is more or less a different project. Since the properties are part of the model, they cannot be used to modify it again - this is the chicken and egg problem. In the light of this it is unfortunate that the tag in the activation is named "property" instead of "systemProperty", because most people make the wrong association. Forget your assumption of evaluating the parent pom first - the model has to be complete to evaluate anything. As a consequence of this behavior you can use a property in the parent, but define (or overwrite) it in the child. - Jörg --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@maven.apache.org For additional commands, e-mail: users-help@maven.apache.org