<?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/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <prerequisites>
        <maven>3.0</maven>
    </prerequisites>

    <parent>
        <groupId>cz.jirutka.maven</groupId>
        <artifactId>root-parent</artifactId>
        <version>1.1.7</version>
        <relativePath>../root-parent/pom.xml</relativePath>
    </parent>


    <!--//////////////////// ABOUT ////////////////////-->

    <artifactId>groovy-parent</artifactId>
    <packaging>pom</packaging>

    <name>Groovy Parent</name>
    <description>Parent POM for OSS projects that uses Groovy (mainly for tests).</description>
    <url>http://github.com/jirutka/maven-support</url>
    <inceptionYear>2013</inceptionYear>

    <licenses>
        <license>
            <name>MIT</name>
            <url>http://opensource.org/licenses/MIT</url>
        </license>
    </licenses>


    <!--//////////////////// PROPERTIES ////////////////////-->

    <properties>
        <groovy.version>2.3.4</groovy.version>
        <groovy-compiler.version>2.9.0-01</groovy-compiler.version>
        <groovy-batch.version>2.3.4-01</groovy-batch.version>
        <spock.version>0.7-groovy-2.0</spock.version>
    </properties>


    <!--//////////////////// DEPENDENCIES ////////////////////-->

    <dependencies>
        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy</artifactId>
            <version>${groovy.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.spockframework</groupId>
                <artifactId>spock-core</artifactId>
                <version>${spock.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.codehaus.groovy</groupId>
                        <artifactId>groovy-all</artifactId>
                    </exclusion>
                </exclusions>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>


    <!--//////////////////// BUILD ////////////////////-->

    <build>
        <plugins>
            <!--
                Compile all classes with Groovy compiler.
            -->
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <compilerId>groovy-eclipse-compiler</compilerId>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.codehaus.groovy</groupId>
                        <artifactId>groovy-eclipse-compiler</artifactId>
                        <version>${groovy-compiler.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.codehaus.groovy</groupId>
                        <artifactId>groovy-eclipse-batch</artifactId>
                        <version>${groovy-batch.version}</version>
                    </dependency>
                </dependencies>
            </plugin>

            <!--
                Add groovy source directories to the build.
                See http://docs.codehaus.org/display/GROOVY/Groovy-Eclipse+compiler+plugin+for+Maven
            -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>add-groovy-source</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>src/main/groovy</source>
                            </sources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>add-groovy-test-source</id>
                        <phase>generate-test-sources</phase>
                        <goals>
                            <goal>add-test-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>src/test/groovy</source>
                            </sources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>add-groovy-it-source</id>
                        <phase>generate-test-sources</phase>
                        <goals>
                            <goal>add-test-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>src/it/groovy</source>
                            </sources>
                        </configuration>
                    </execution>
                    <execution>
                        <id>add-it-resource</id>
                        <phase>generate-test-resources</phase>
                        <goals>
                            <goal>add-test-resource</goal>
                        </goals>
                        <configuration>
                            <resources>
                                <resource>
                                    <directory>src/it/resources</directory>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
