You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2008/09/30 17:30:56 UTC

svn commit: r700499 - in /maven/plugins/trunk/maven-invoker-plugin/src: it/pom-filtering/ it/pom-filtering/src/it/project/ main/java/org/apache/maven/plugin/invoker/ site/apt/examples/

Author: bentmann
Date: Tue Sep 30 08:30:56 2008
New Revision: 700499

URL: http://svn.apache.org/viewvc?rev=700499&view=rev
Log:
[MINVOKER-69] Filter token "basedir" no longer interpolated

Modified:
    maven/plugins/trunk/maven-invoker-plugin/src/it/pom-filtering/pom.xml
    maven/plugins/trunk/maven-invoker-plugin/src/it/pom-filtering/src/it/project/pom.xml
    maven/plugins/trunk/maven-invoker-plugin/src/it/pom-filtering/verify.bsh
    maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java
    maven/plugins/trunk/maven-invoker-plugin/src/site/apt/examples/filtering.apt.vm

Modified: maven/plugins/trunk/maven-invoker-plugin/src/it/pom-filtering/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/pom-filtering/pom.xml?rev=700499&r1=700498&r2=700499&view=diff
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/pom-filtering/pom.xml (original)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/pom-filtering/pom.xml Tue Sep 30 08:30:56 2008
@@ -57,6 +57,7 @@
             <project.name>FAILED</project.name>
             <itProperty>PASSED</itProperty>
             <project.nonExistingPomValue>PASSED</project.nonExistingPomValue>
+            <basedir>FAILED</basedir>
           </filterProperties>
         </configuration>
         <executions>

Modified: maven/plugins/trunk/maven-invoker-plugin/src/it/pom-filtering/src/it/project/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/pom-filtering/src/it/project/pom.xml?rev=700499&r1=700498&r2=700499&view=diff
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/pom-filtering/src/it/project/pom.xml (original)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/pom-filtering/src/it/project/pom.xml Tue Sep 30 08:30:56 2008
@@ -43,6 +43,10 @@
     <prop7>@itProperty@</prop7>
     <!-- properties with prefix "project"/"pom" must fallback to plugin config if no matching POM value exists -->
     <prop8>@project.nonExistingPomValue@</prop8>
+    <!-- built-in properties must not be overridden by properties from the plugin configuration -->
+    <prop9>@basedir@</prop9>
+    <prop10>@localRepository@</prop10>
+    <prop11>@localRepositoryUrl@</prop11>
   </properties>
 
   <build>

Modified: maven/plugins/trunk/maven-invoker-plugin/src/it/pom-filtering/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/pom-filtering/verify.bsh?rev=700499&r1=700498&r2=700499&view=diff
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/pom-filtering/verify.bsh (original)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/pom-filtering/verify.bsh Tue Sep 30 08:30:56 2008
@@ -44,6 +44,22 @@
             return false;
         }
     }
+    
+    String[] badValues = {
+            "<prop9>@basedir@</prop9>",
+            "<prop9>FAILED</prop9>",
+            "<prop10>@localRepository@</prop10>",
+            "<prop11>@localRepositoryUrl@</prop11>",
+        };
+    for ( String value : badValues )
+    {
+        System.out.println( "Checking for absence of: " + value );
+        if ( xml.indexOf( value ) >= 0 )
+        {
+            System.out.println( "FAILED!" );
+            return false;
+        }
+    }
 }
 catch( Throwable t )
 {

Modified: maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java?rev=700499&r1=700498&r2=700499&view=diff
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java (original)
+++ maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java Tue Sep 30 08:30:56 2008
@@ -1631,6 +1631,7 @@
         {
             props.putAll( filterProperties );
         }
+        props.put( "basedir", this.project.getBasedir().getAbsolutePath() );
         if ( settings.getLocalRepository() != null )
         {
             props.put( "localRepository", settings.getLocalRepository() );

Modified: maven/plugins/trunk/maven-invoker-plugin/src/site/apt/examples/filtering.apt.vm
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/site/apt/examples/filtering.apt.vm?rev=700499&r1=700498&r2=700499&view=diff
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/site/apt/examples/filtering.apt.vm (original)
+++ maven/plugins/trunk/maven-invoker-plugin/src/site/apt/examples/filtering.apt.vm Tue Sep 30 08:30:56 2008
@@ -105,8 +105,8 @@
   is not <<<null>>>.
 
   [[1]] Tokens of the form <<<project.*>>> and <<<pom.*>>> will be expanded to the referenced POM value if possible,
-        e.g. <<<project.version>>> refers to the version given in <<<pom.xml>>>. If no such POM element exists, the
-        value lookup continues as outlined next.
+        e.g. <<<project.version>>> refers to the version given in the <<<pom.xml>>> that executed the Invoker Plugin.
+        If no such POM element exists, the value lookup continues as outlined next.
 
   [[2]] Built-in properties defined by the Invoker Plugin will be processed. See this table for a list of available
         built-in properties:
@@ -114,6 +114,8 @@
 *--------------------------+----------------------------------------------------------------------------------+--------+
 || Built-in Property       || Value                                                                           || Since |
 *--------------------------+----------------------------------------------------------------------------------+--------+
+| <<<basedir>>>            | The absolute path to the project base directory of the main build.               | 1.1    |
+*--------------------------+----------------------------------------------------------------------------------+--------+
 | <<<localRepository>>>    | The absolute path to the local repository used for the main build.               | 1.2    |
 *--------------------------+----------------------------------------------------------------------------------+--------+
 | <<<localRepositoryUrl>>> | The <<<file:>>> URL to the local repository used for the main build.             | 1.3    |