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/05/03 11:59:05 UTC

svn commit: r653031 - in /maven/plugins/trunk/maven-invoker-plugin/src: main/java/org/apache/maven/plugin/invoker/InvokerMojo.java site/apt/examples/access-test-classes.apt site/apt/index.apt site/site.xml

Author: bentmann
Date: Sat May  3 02:59:05 2008
New Revision: 653031

URL: http://svn.apache.org/viewvc?rev=653031&view=rev
Log:
[MINVOKER-6] Add current's project test classpath to the Bean Shell interpreter classpath

o Extended docs

Added:
    maven/plugins/trunk/maven-invoker-plugin/src/site/apt/examples/access-test-classes.apt   (with props)
Modified:
    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/index.apt
    maven/plugins/trunk/maven-invoker-plugin/src/site/site.xml

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=653031&r1=653030&r2=653031&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 Sat May  3 02:59:05 2008
@@ -351,7 +351,7 @@
     private String mavenOpts;
 
     /**
-     * The file encoding for the BeanShell scripts and the list files for goals and profiles.
+     * The file encoding for the pre-/post-build scripts and the list files for goals and profiles.
      * 
      * @parameter expression="${encoding}" default-value="${project.build.sourceEncoding}"
      * @since 1.2
@@ -369,9 +369,11 @@
     private Settings settings;    
 
     /**
-     * A flag whether the test class path of the project under test should be added to the class path of the BeanShell
-     * scripts. If set to <code>false</code>, the scripts can only access classes from the <a
-     * href="dependencies.html">runtime class path</a> of the Maven Invoker Plugin.
+     * A flag whether the test class path of the project under test should be included in the class path of the
+     * pre-/post-build scripts. If set to <code>false</code>, the class path of script interpreter consists only of
+     * the <a href="dependencies.html">runtime dependencies</a> of the Maven Invoker Plugin. If set the
+     * <code>true</code>, the project's test class path will be prepended to the interpreter class path. Among
+     * others, this feature allows the scripts to access utility classes from the test sources of your project.
      * 
      * @parameter expression="${invoker.addTestClassPath}" default-value="false"
      * @since 1.2

Added: maven/plugins/trunk/maven-invoker-plugin/src/site/apt/examples/access-test-classes.apt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/site/apt/examples/access-test-classes.apt?rev=653031&view=auto
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/site/apt/examples/access-test-classes.apt (added)
+++ maven/plugins/trunk/maven-invoker-plugin/src/site/apt/examples/access-test-classes.apt Sat May  3 02:59:05 2008
@@ -0,0 +1,42 @@
+ ------
+ Accessing Test Classes
+ ------
+ Benjamin Bentmann
+ ------
+ 03 May 2008
+ ------
+
+Accessing Test Classes
+ 
+  In case your pre-/post-build scripts perform complex operations that you would rather like to refactor out into some
+  utility class instead of copy&pasting them in each script, you can use the parameter <<<addTestClassPath>>>:
+
++----
+<project>
+  <build>
+    <plugins>
+      <plugin>
+        <artifactId>maven-invoker-plugin</artifactId>
+        <version>1.2</version>
+        <executions>
+          <execution>
+            <id>integration-test</id>
+            <phase>integration-test</phase>
+            <goals>
+              <goal>run</goal>
+            </goals>
+            <configuration>
+              <addTestClassPath>true</addTestClassPath>
+            </configuration>
+          </execution>
+       </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>
++----
+
+  Setting <<<addTestClassPath>>> to <<<true>>> will prepend the directory <<<$\{project.build.testOutputDirectory\}>>>
+  and all dependencies of your project to the class path of the script interpreter. Of course, this requires your test
+  classes to be compiled before running the integration tests but this is usually the case if you employ the Invoker
+  Plugin during the lifecycle phase <<<integration-test>>>.

Propchange: maven/plugins/trunk/maven-invoker-plugin/src/site/apt/examples/access-test-classes.apt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/plugins/trunk/maven-invoker-plugin/src/site/apt/examples/access-test-classes.apt
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: maven/plugins/trunk/maven-invoker-plugin/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/site/apt/index.apt?rev=653031&r1=653030&r2=653031&view=diff
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/site/apt/index.apt (original)
+++ maven/plugins/trunk/maven-invoker-plugin/src/site/apt/index.apt Sat May  3 02:59:05 2008
@@ -32,4 +32,8 @@
   
   * {{{examples/post-build-script.html}Run a BeanShell script}} to verify project output.
   
+  * {{{examples/fast-use.html}Fast Invoker Plugin configuration}} to accelerate test execution.
+  
+  * {{{examples/access-test-classes.html}Access test classes}} to share code between IT scripts.
+  
   []

Modified: maven/plugins/trunk/maven-invoker-plugin/src/site/site.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/site/site.xml?rev=653031&r1=653030&r2=653031&view=diff
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/site/site.xml (original)
+++ maven/plugins/trunk/maven-invoker-plugin/src/site/site.xml Sat May  3 02:59:05 2008
@@ -35,6 +35,7 @@
       <item name="Install Artifacts" href="examples/install-artifacts.html"/>
       <item name="Post Build Script" href="examples/post-build-script.html"/>
       <item name="Fast Use" href="examples/fast-use.html"/>
+      <item name="Access Test Classes" href="examples/access-test-classes.html"/>
     </menu>
     
   </body>