maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From and...@apache.org
Subject svn commit: r1537603 - in /maven/plugins/trunk/maven-invoker-plugin/src: it/script-global-vars/src/it/beanshell/ it/script-global-vars/src/it/groovy/ main/java/org/apache/maven/plugin/invoker/ site/apt/examples/
Date Thu, 31 Oct 2013 19:54:54 GMT
Author: andham
Date: Thu Oct 31 19:54:54 2013
New Revision: 1537603

URL: http://svn.apache.org/r1537603
Log:
[MINVOKER-122] Import information into groovy scripts of the running Maven environment

Modified:
    maven/plugins/trunk/maven-invoker-plugin/src/it/script-global-vars/src/it/beanshell/setup.bsh
    maven/plugins/trunk/maven-invoker-plugin/src/it/script-global-vars/src/it/beanshell/verify.bsh
    maven/plugins/trunk/maven-invoker-plugin/src/it/script-global-vars/src/it/groovy/setup.groovy
    maven/plugins/trunk/maven-invoker-plugin/src/it/script-global-vars/src/it/groovy/verify.groovy
    maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/AbstractInvokerMojo.java
    maven/plugins/trunk/maven-invoker-plugin/src/site/apt/examples/post-build-script.apt.vm

Modified: maven/plugins/trunk/maven-invoker-plugin/src/it/script-global-vars/src/it/beanshell/setup.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/script-global-vars/src/it/beanshell/setup.bsh?rev=1537603&r1=1537602&r2=1537603&view=diff
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/script-global-vars/src/it/beanshell/setup.bsh
(original)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/script-global-vars/src/it/beanshell/setup.bsh
Thu Oct 31 19:54:54 2013
@@ -17,6 +17,18 @@ try
         System.out.println( "Global script variable not defined: localRepositoryPath" );
         return false;
     }
+
+    System.out.println( mavenVersion );
+    if ( mavenVersion == null )
+    {
+        System.out.println( "Global script variable not defined: mavenVersion" );
+        return false;
+    }
+    if ( mavenVersion.trim().equals( "" ) )
+    {
+        System.out.println( "Global script variable empty: mavenVersion" );
+        return false;
+    }
 }
 catch( Throwable t )
 {

Modified: maven/plugins/trunk/maven-invoker-plugin/src/it/script-global-vars/src/it/beanshell/verify.bsh
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/script-global-vars/src/it/beanshell/verify.bsh?rev=1537603&r1=1537602&r2=1537603&view=diff
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/script-global-vars/src/it/beanshell/verify.bsh
(original)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/script-global-vars/src/it/beanshell/verify.bsh
Thu Oct 31 19:54:54 2013
@@ -17,6 +17,18 @@ try
         System.out.println( "Global script variable not defined: localRepositoryPath" );
         return false;
     }
+
+    System.out.println( mavenVersion );
+    if ( mavenVersion == null )
+    {
+        System.out.println( "Global script variable not defined: mavenVersion" );
+        return false;
+    }
+    if ( mavenVersion.trim().equals( "" ) )
+    {
+        System.out.println( "Global script variable empty: mavenVersion" );
+        return false;
+    }
 }
 catch( Throwable t )
 {

Modified: maven/plugins/trunk/maven-invoker-plugin/src/it/script-global-vars/src/it/groovy/setup.groovy
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/script-global-vars/src/it/groovy/setup.groovy?rev=1537603&r1=1537602&r2=1537603&view=diff
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/script-global-vars/src/it/groovy/setup.groovy
(original)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/script-global-vars/src/it/groovy/setup.groovy
Thu Oct 31 19:54:54 2013
@@ -17,6 +17,18 @@ try
         println "Global script variable not defined: localRepositoryPath"
         return false
     }
+
+    println mavenVersion
+    if ( !mavenVersion )
+    {
+        println "Global script variable not defined: mavenVersion"
+        return false
+    }
+    if ( !mavenVersion?.trim() )
+    {
+        println "Global script variable empty: mavenVersion"
+        return false
+    }
 }
 catch( Throwable t )
 {

Modified: maven/plugins/trunk/maven-invoker-plugin/src/it/script-global-vars/src/it/groovy/verify.groovy
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/it/script-global-vars/src/it/groovy/verify.groovy?rev=1537603&r1=1537602&r2=1537603&view=diff
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/it/script-global-vars/src/it/groovy/verify.groovy
(original)
+++ maven/plugins/trunk/maven-invoker-plugin/src/it/script-global-vars/src/it/groovy/verify.groovy
Thu Oct 31 19:54:54 2013
@@ -17,6 +17,18 @@ try
         println "Global script variable not defined: localRepositoryPath"
         return false
     }
+
+    println mavenVersion
+    if ( !mavenVersion )
+    {
+        println "Global script variable not defined: mavenVersion"
+        return false
+    }
+    if ( !mavenVersion?.trim() )
+    {
+        println "Global script variable empty: mavenVersion"
+        return false
+    }
 }
 catch( Throwable t )
 {

Modified: maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/AbstractInvokerMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/AbstractInvokerMojo.java?rev=1537603&r1=1537602&r2=1537603&view=diff
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/AbstractInvokerMojo.java
(original)
+++ maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/AbstractInvokerMojo.java
Thu Oct 31 19:54:54 2013
@@ -1177,6 +1177,7 @@ public abstract class AbstractInvokerMoj
         {
             actualMavenVersion = SelectorUtils.getMavenVersion();
         }
+        scriptRunner.setGlobalVariable( "mavenVersion", actualMavenVersion );
         
         if ( javaHome != null )
         {

Modified: maven/plugins/trunk/maven-invoker-plugin/src/site/apt/examples/post-build-script.apt.vm
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/site/apt/examples/post-build-script.apt.vm?rev=1537603&r1=1537602&r2=1537603&view=diff
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/site/apt/examples/post-build-script.apt.vm
(original)
+++ maven/plugins/trunk/maven-invoker-plugin/src/site/apt/examples/post-build-script.apt.vm
Thu Oct 31 19:54:54 2013
@@ -90,6 +90,8 @@ if ( !file.isFile() )
 *--------------------------+----------------------+-----------------------------------------------------------+--------+
 | <<<context>>>            | <<<java.util.Map>>>  | The
storage of key-value pairs used to pass data from the pre-build hook script to the post-build
hook script. | 1.4   |
 *--------------------------+----------------------+-----------------------------------------------------------+--------+
+| <<<mavenVersion>>>       | <<<java.lang.String>>> |
The version of Maven executing on the test project.     | 1.9    |
+*--------------------------+----------------------+-----------------------------------------------------------+--------+
 
   Additional variables that can be accessed in the hook scripts can be defined through the
   <<<{{{../run-mojo.html#scriptVariables}scriptVariables}}>>> parameter
in the Invoker Plugin's configuration.
\ No newline at end of file



Mime
View raw message