<?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">
  <parent>
    <artifactId>cucumber-jvm</artifactId>
    <groupId>info.cukes</groupId>
    <version>1.1.2</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>cucumber-groovy</artifactId>
  <name>Cucumber-JVM: Groovy</name>
  <build>
    <plugins>
      <plugin>
        <groupId>org.codehaus.gmaven</groupId>
        <artifactId>gmaven-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>generateStubs</goal>
              <goal>compile</goal>
              <goal>generateTestStubs</goal>
              <goal>testCompile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <configuration>
          <filesets>
            <fileset>
              <directory>bin</directory>
              <includes>
                <include>*.jar</include>
              </includes>
            </fileset>
          </filesets>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>generate-i18n-sources</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <target>
                <taskdef />
                <groovy>import groovy.text.SimpleTemplateEngine
import gherkin.I18n

def engine = new SimpleTemplateEngine()
def templateSource = new File(project.baseDir, "src${File.separator}main${File.separator}code_generator${File.separator}I18n.groovy.txt").getText()

I18n.all.each { i18n -&gt;
    def binding = ["i18n":i18n]
    template = engine.createTemplate(templateSource).make(binding)
    def file = new File(project.baseDir, "target${File.separator}generated-sources${File.separator}i18n${File.separator}java${File.separator}cucumber${File.separator}api${File.separator}groovy${File.separator}${i18n.underscoredIsoCode.toUpperCase()}.java")
    file.parentFile.mkdirs()
    file.write(template.toString(), "UTF-8")
}</groovy>
              </target>
            </configuration>
          </execution>
          <execution>
            <id>copy-full-jar</id>
            <phase>package</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <target>
                <copy />
              </target>
            </configuration>
          </execution>
          <execution>
            <id>groovy-cli-test</id>
            <phase>integration-test</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <target>
                <echo />
                <java>
                  <classpath>
                    <pathelement />
                    <pathelement />
                    <pathelement />
                    <pathelement />
                  </classpath>
                  <arg />
                  <arg />
                  <arg />
                  <arg />
                  <arg />
                </java>
              </target>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>add-source</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>${basedir}/target/generated-sources/i18n/java</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <includes>
            <include>**/*.java</include>
          </includes>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>info.cukes</groupId>
      <artifactId>cucumber-jvm-deps</artifactId>
      <version>1.0.3</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <artifactId>xstream</artifactId>
          <groupId>com.thoughtworks.xstream</groupId>
        </exclusion>
        <exclusion>
          <artifactId>diffutils</artifactId>
          <groupId>com.googlecode.java-diff-utils</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>info.cukes</groupId>
      <artifactId>gherkin</artifactId>
      <version>2.11.6</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.codehaus.groovy</groupId>
      <artifactId>groovy-all</artifactId>
      <version>2.1.0</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>info.cukes</groupId>
      <artifactId>cucumber-junit</artifactId>
      <version>1.1.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>hamcrest-core</artifactId>
          <groupId>org.hamcrest</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>net.sourceforge.cobertura</groupId>
      <artifactId>cobertura</artifactId>
      <version>1.9.4.1</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>oro</artifactId>
          <groupId>oro</groupId>
        </exclusion>
        <exclusion>
          <artifactId>asm</artifactId>
          <groupId>asm</groupId>
        </exclusion>
        <exclusion>
          <artifactId>asm-tree</artifactId>
          <groupId>asm</groupId>
        </exclusion>
        <exclusion>
          <artifactId>log4j</artifactId>
          <groupId>log4j</groupId>
        </exclusion>
        <exclusion>
          <artifactId>ant</artifactId>
          <groupId>org.apache.ant</groupId>
        </exclusion>
      </exclusions>
    </dependency>
  </dependencies>
  <properties>
    <gmaven.runtime>1.8</gmaven.runtime>
  </properties>
</project>

