Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
xml
xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <!-- This examples assumes your main Groovy is in src/main/groovy and your test Groovy is in src/test/groovy. -->
  <!-- The version of Groovy used in the example requires Java 6 or higher. -->
  <!-- This example won't work for Groovy that depends on Java or circular dependencies between Java and Groovy. -->

  <groupId>org.codehaus.groovy</groupId>
  <artifactId>groovyc-via-ant-test</artifactId>
  <name>test groovcy project</name>
  <version>1.0-SNAPSHOT</version>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>1.7</maven.compiler.source>
    <maven.compiler.target>1.7</maven.compiler.target>
    <groovyVersion>2.3.2</groovyVersion>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.codehaus.groovy</groupId>
      <artifactId>groovy-all</artifactId>
      <version>${groovyVersion}</version>
      <!-- uncommentUncomment line below to use invokedynamic version of Groovy (requires Java 7 or higher). -->
      <!--<classifier>indy</classifier>-->
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>1.7</version>
        <executions>
          <execution>
            <id>compile</id>
            <phase>generate-sources</phase>
            <configuration>
              <target>
                <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc">
                  <classpath refid="maven.compile.classpath" />
                </taskdef>
                <mkdir dir="${project.build.outputDirectory}" />
                <groovyc srcdir="${basedir}/src/main/groovy" destdir="${project.build.outputDirectory}" encoding="${project.build.sourceEncoding}">
                  <classpath refid="maven.compile.classpath" />
                </groovyc>
              </target>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
          <execution>
            <id>test-compile</id>
            <phase>generate=-test-sources</phase>
            <configuration>
              <target>
                <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc">
                  <classpath refid="maven.test.classpath" />
                </taskdef>
                <mkdir dir="${project.build.testOutputDirectory}" />
                <groovyc srcdir="${basedir}/src/test/groovy" destdir="${project.build.testOutputDirectory}" encoding="${project.build.sourceEncoding}">
                  <classpath refid="maven.test.classpath" />
                </groovyc>
              </target>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
      </plugin>
    </plugins>
  </build>
</project>
</project>

...