You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ca...@apache.org on 2005/11/29 03:56:54 UTC
svn commit: r349599 - in /maven/plugins/trunk/maven-antrun-plugin/src:
main/java/org/apache/maven/plugin/antrun/AntRunMojo.java site/apt/usage.apt
Author: carlos
Date: Mon Nov 28 18:56:51 2005
New Revision: 349599
URL: http://svn.apache.org/viewcvs?rev=349599&view=rev
Log:
Improved docs
Submitted by: Lee Meador
PR: MNG-1660
Modified:
maven/plugins/trunk/maven-antrun-plugin/src/main/java/org/apache/maven/plugin/antrun/AntRunMojo.java
maven/plugins/trunk/maven-antrun-plugin/src/site/apt/usage.apt
Modified: maven/plugins/trunk/maven-antrun-plugin/src/main/java/org/apache/maven/plugin/antrun/AntRunMojo.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-antrun-plugin/src/main/java/org/apache/maven/plugin/antrun/AntRunMojo.java?rev=349599&r1=349598&r2=349599&view=diff
==============================================================================
--- maven/plugins/trunk/maven-antrun-plugin/src/main/java/org/apache/maven/plugin/antrun/AntRunMojo.java (original)
+++ maven/plugins/trunk/maven-antrun-plugin/src/main/java/org/apache/maven/plugin/antrun/AntRunMojo.java Mon Nov 28 18:56:51 2005
@@ -51,19 +51,26 @@
private MavenProject project;
/**
- * Any ant task. You can add anything you can add between <target> and </target> in a build.xml.
+ * The XML for the Ant task. You can add anything you can add
+ * between <target> and </target> in a build.xml.
* @parameter expression="${tasks}"
*/
private Target tasks;
/**
- * If you generate sources set this property to the target dir so they are available for compilation
+ * This folder is added to the list of those folders
+ * containing source to be compiled. Use this if your
+ * ant script generates source code.
+ *
* @parameter expression="${sourceRoot}"
*/
private File sourceRoot;
/**
- * If you generate test sources set this property to the target dir so they are available for compilation
+ * This folder is added to the list of those folders
+ * containing source to be compiled for testing. Use this if your
+ * ant script generates test source code.
+ *
* @parameter expression="${testSourceRoot}"
*/
private File testSourceRoot;
Modified: maven/plugins/trunk/maven-antrun-plugin/src/site/apt/usage.apt
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-antrun-plugin/src/site/apt/usage.apt?rev=349599&r1=349598&r2=349599&view=diff
==============================================================================
--- maven/plugins/trunk/maven-antrun-plugin/src/site/apt/usage.apt (original)
+++ maven/plugins/trunk/maven-antrun-plugin/src/site/apt/usage.apt Mon Nov 28 18:56:51 2005
@@ -52,3 +52,58 @@
lifecycle phase. You can add a script to each lifecycle phase,
by duplicating the <<<\<execution/\>>>> section and specifying
a new phase.
+
+
+ Below you can see how to indicate that ant has generated some more java
+ source that needs to be included in the compilation phase. Note that the
+ compile phase follows the generate-sources phase in the lifecycle.
+
+------
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>my-test-app</artifactId>
+ <groupId>my-test-group</groupId>
+ <version>1.0-SNAPSHOT</version>
+
+ <build>
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>generate-sources</phase>
+ <configuration>
+ <tasks>
+
+ <!--
+ Place any ant task here. You can add anything
+ you can add between <target> and </target> in a
+ build.xml.
+ -->
+
+ </tasks>
+ <sourceRoot>${project.build.directory}/generated-sources/main/java</sourceRoot>
+ <testSourceRoot>${project.build.directory}/generated-sources/test/java</testSourceRoot>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+</project>
+------
+
+ Of course, you can put whatever folder you prefer. The folders in the example above are
+ handy because they are deleted when you "clean" since they are in the build directory
+ (which is, by default, "target").
+
+ <<<\<sourceRoot/\>>>> adds a single folder to the
+ list of folders that get compiled with the program source code (compile).
+
+ <<<\<testSourceRoot/\>>>> adds a single folder to the
+ list of folders that get compiled with the test source code (test-compile).