You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2017/12/20 09:27:19 UTC

[maven-antrun-plugin] 10/26: Improved docs Submitted by: Lee Meador PR: MNG-1660

This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to annotated tag maven-antrun-plugin-1.1
in repository https://gitbox.apache.org/repos/asf/maven-antrun-plugin.git

commit 207451cbcc78254756deccbed734fd5ccd9f1051
Author: Carlos Sanchez Gonzalez <ca...@apache.org>
AuthorDate: Tue Nov 29 02:56:51 2005 +0000

    Improved docs
    Submitted by: Lee Meador
    PR: MNG-1660
    
    git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-antrun-plugin@349599 13f79535-47bb-0310-9956-ffa450edef68
---
 .../org/apache/maven/plugin/antrun/AntRunMojo.java | 13 +++--
 src/site/apt/usage.apt                             | 55 ++++++++++++++++++++++
 2 files changed, 65 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugin/antrun/AntRunMojo.java b/src/main/java/org/apache/maven/plugin/antrun/AntRunMojo.java
index be93efa..408e24a 100644
--- a/src/main/java/org/apache/maven/plugin/antrun/AntRunMojo.java
+++ b/src/main/java/org/apache/maven/plugin/antrun/AntRunMojo.java
@@ -51,19 +51,26 @@ public class AntRunMojo
     private MavenProject project;
 
     /**
-     * Any ant task. You can add anything you can add between &lt;target> and &lt;/target> in a build.xml.
+     * The XML for the Ant task. You can add anything you can add 
+     * between &lt;target> and &lt;/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;
diff --git a/src/site/apt/usage.apt b/src/site/apt/usage.apt
index 87b0fac..d505e03 100644
--- a/src/site/apt/usage.apt
+++ b/src/site/apt/usage.apt
@@ -52,3 +52,58 @@ Usage
   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).

-- 
To stop receiving notification emails like this one, please contact
"commits@maven.apache.org" <co...@maven.apache.org>.