Repository: maven
Updated Branches:
  refs/heads/master 19247f363 -> 3c7744a9a


[MNG-5590] improved documentation about interpolation on file activation

Project: http://git-wip-us.apache.org/repos/asf/maven/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven/commit/3c7744a9
Tree: http://git-wip-us.apache.org/repos/asf/maven/tree/3c7744a9
Diff: http://git-wip-us.apache.org/repos/asf/maven/diff/3c7744a9

Branch: refs/heads/master
Commit: 3c7744a9a06977a575e073f72a57ca9e32b7dc65
Parents: 19247f3
Author: Hervé Boutemy <[email protected]>
Authored: Sun Mar 23 16:36:01 2014 +0100
Committer: Hervé Boutemy <[email protected]>
Committed: Sun Mar 23 16:36:01 2014 +0100

----------------------------------------------------------------------
 .../model/profile/activation/FileProfileActivator.java  |  4 ++++
 maven-model-builder/src/site/apt/index.apt              | 12 +++++++++---
 maven-model/src/main/mdo/maven.mdo                      | 10 ++++++----
 3 files changed, 19 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven/blob/3c7744a9/maven-model-builder/src/main/java/org/apache/maven/model/profile/activation/FileProfileActivator.java
----------------------------------------------------------------------
diff --git 
a/maven-model-builder/src/main/java/org/apache/maven/model/profile/activation/FileProfileActivator.java
 
b/maven-model-builder/src/main/java/org/apache/maven/model/profile/activation/FileProfileActivator.java
index bcad941..039c37b 100644
--- 
a/maven-model-builder/src/main/java/org/apache/maven/model/profile/activation/FileProfileActivator.java
+++ 
b/maven-model-builder/src/main/java/org/apache/maven/model/profile/activation/FileProfileActivator.java
@@ -39,6 +39,10 @@ import org.codehaus.plexus.util.StringUtils;
 
 /**
  * Determines profile activation based on the existence/absence of some file.
+ * File name interpolation support is limited to <code>${basedir}</code>,
+ * System properties and request properties.
+ * <code>${project.basedir}</code> is intentionally not supported as this form 
would suggest that other
+ * <code>${project.*}</code> expressions can be used, which is however beyond 
the design.
  * 
  * @author Benjamin Bentmann
  * @see ActivationFile

http://git-wip-us.apache.org/repos/asf/maven/blob/3c7744a9/maven-model-builder/src/site/apt/index.apt
----------------------------------------------------------------------
diff --git a/maven-model-builder/src/site/apt/index.apt 
b/maven-model-builder/src/site/apt/index.apt
index 3a60c34..69aa8a4 100644
--- a/maven-model-builder/src/site/apt/index.apt
+++ b/maven-model-builder/src/site/apt/index.apt
@@ -25,7 +25,7 @@
 
 Maven Model Builder
 
- The effective model builder, with inheritance, profile activation, 
interpolation, ...
+ The effective model builder, with profile activation, inheritance, 
interpolation, ...
 
  The main component is <<<ModelBuilder>>>
  ({{{./apidocs/org/apache/maven/model/building/ModelBuilder.html}javadoc}},
@@ -39,7 +39,9 @@ Maven Model Builder
 
  * phase 1
 
-   ** profile activation (see 
{{{./apidocs/org/apache/maven/model/profile/activation/package-summary.html}available
 activators}})
+   ** profile activation: see 
{{{./apidocs/org/apache/maven/model/profile/activation/package-summary.html}available
 activators}}.
+   Notice that model interpolation hasn't happened yet, then interpolation for 
file-based activation is limited to
+   <<<$\{basedir}>>>, System properties and request properties
 
    ** model normalization: <<<ModelNormalizer>>> 
({{{./apidocs/org/apache/maven/model/normalization/ModelNormalizer.html}javadoc}}),
    with its <<<DefaultModelNormalizer>>> implementation
@@ -96,6 +98,10 @@ Maven Model Builder
   
({{{./apidocs/org/apache/maven/model/interpolation/StringSearchModelInterpolator.html}javadoc}},
   
{{{./xref/org/apache/maven/model/interpolation/StringSearchModelInterpolator.html}source}}).
 
+  Notice that model interpolation happens <after> profile activation, then 
profile activation doesn't benefit from every values:
+  interpolation for file-based activation is limited to <<<$\{basedir}>>> 
(which is not deprecated in this context),
+  System properties and request properties.
+
   Values are evaluated in sequence from different syntaxes:
 
 *----+------+------+
@@ -156,4 +162,4 @@ Maven Model Builder
 
     []
 
-  []
+  []
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/maven/blob/3c7744a9/maven-model/src/main/mdo/maven.mdo
----------------------------------------------------------------------
diff --git a/maven-model/src/main/mdo/maven.mdo 
b/maven-model/src/main/mdo/maven.mdo
index eb8bcd8..393d5e1 100644
--- a/maven-model/src/main/mdo/maven.mdo
+++ b/maven-model/src/main/mdo/maven.mdo
@@ -3246,10 +3246,12 @@
     <class java.clone="deep">
       <name>ActivationFile</name>
       <version>4.0.0+</version>
-      <description>This is the file specification used to activate the 
profile. The missing value
-        will be the location of a file that needs to exist, and if it doesn't 
the profile will be
-        activated. On the other hand exists will test for the existence of the 
file and if it is
-        there the profile will be activated.</description>
+      <description><![CDATA[This is the file specification used to activate 
the profile. The <code>missing</code> value
+        is the location of a file that needs to exist, and if it doesn't, the 
profile will be
+        activated. On the other hand, <code>exists</code> will test for the 
existence of the file and if it is
+        there, the profile will be activated.<br/>
+        Variable interpolation for these file specifications is limited to 
<code>${basedir}</code>,
+        System properties and request properties.]]></description>
       <fields>
         <field>
           <name>missing</name>

Reply via email to