OSDN Git Service

maven-antrun-pluginを使用したGroovyのコンパイル
authoryukihane <yukihane.feather@gmail.com>
Sun, 29 Jul 2012 05:22:45 +0000 (14:22 +0900)
committeryukihane <yukihane.feather@gmail.com>
Sun, 29 Jul 2012 05:22:45 +0000 (14:22 +0900)
pom.xml

diff --git a/pom.xml b/pom.xml
index e4e2ada..65a06fe 100644 (file)
--- a/pom.xml
+++ b/pom.xml
         <directory>test/testdata</directory>
       </testResource>
     </testResources>
+
     <plugins>
       <plugin>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>compile</id>
+            <phase>compile</phase>
+            <configuration>
+              <tasks>
+                <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc">
+                  <classpath refid="maven.compile.classpath"/>
+                </taskdef>
+                <mkdir dir="${project.build.outputDirectory}"/>
+                <groovyc destdir="${project.build.outputDirectory}" listfiles="true">
+                  <classpath refid="maven.compile.classpath"/>
+                </groovyc>
+              </tasks>
+            </configuration>
+          <goals>
+            <goal>run</goal>
+          </goals>
+        </execution>
+        <execution>
+          <id>test-compile</id>
+          <phase>test-compile</phase>
+          <configuration>
+            <tasks>
+              <mkdir dir="${basedir}/src/test/groovy"/>
+              <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc">
+                <classpath refid="maven.test.classpath"/>
+              </taskdef>
+              <mkdir dir="${project.build.testOutputDirectory}"/>
+              <groovyc destdir="${project.build.testOutputDirectory}" srcdir="${basedir}/src/test/groovy/" listfiles="true">
+                <classpath refid="maven.test.classpath"/>
+              </groovyc>
+            </tasks>
+          </configuration>
+          <goals>
+            <goal>run</goal>
+          </goals>
+        </execution>
+      </executions>
+    </plugin>
+    <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-compiler-plugin</artifactId>
         <configuration>