<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>

    <parent>
        <groupId>javax.cache</groupId>
        <artifactId>implementation-tester</artifactId>
        <version>1.0.0</version>
    </parent>

    <artifactId>guice-annotations-tester</artifactId>
    <packaging>jar</packaging>
    <name>Implementation Tester - Guice Annotations</name>
    <url>https://github.com/jsr107/jsr107tck</url>
    <description>Runs Annotations tests using the Guice test harness</description>



    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <annotation-harness-groupId>javax.cache</annotation-harness-groupId>
        <annotation-harness-artifactId>guice-annotations-test-harness</annotation-harness-artifactId>
        <annotation-harness-version>${project.parent.version}</annotation-harness-version>

    </properties>

    <dependencies>
        <dependency>
            <groupId>${implementation-groupId}</groupId>
            <artifactId>${implementation-artifactId}</artifactId>
            <version>${implementation-version}</version>
        </dependency>

        <!-- 
            Is there a way to have the cache RI impl check if one of the annotations RIs is available
            before stating it supports annotations?
         -->

        <dependency>
            <groupId>${annotation-harness-groupId}</groupId>
            <artifactId>${annotation-harness-artifactId}</artifactId>
            <version>${annotation-harness-version}</version>
        </dependency>

        <dependency>
            <groupId>javax.cache</groupId>
            <artifactId>cache-tests</artifactId>
            <version>${project.parent.version}</version>
        </dependency>

        <dependency>
            <groupId>javax.cache</groupId>
            <artifactId>cache-tests</artifactId>
            <classifier>tests</classifier>
            <scope>test</scope>
            <version>${project.parent.version}</version>
        </dependency>


        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-library</artifactId>
            <version>1.2</version>
            <scope>test</scope>
        </dependency>

        <!-- Logging to figure out what the heck is going on -->
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.16</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <testResources>
            <testResource>
                <directory>../src/test/resources</directory>
                <filtering>true</filtering>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.8</version>
                <executions>
                    <!--Required because JUnit will not detect tests simply included in a dep-->
                    <execution>
                        <id>copy-cache-tests</id>
                        <goals>
                            <goal>unpack-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.testOutputDirectory}
                            </outputDirectory>
                            <includeArtifactIds>cache-tests</includeArtifactIds>
                            <includeScope>test</includeScope>
                        </configuration>
                    </execution>
                    <execution>
                        <id>copy-domain</id>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>javax.cache</groupId>
                                    <artifactId>app-domain</artifactId>
                                    <version>${project.parent.version}</version>
                                    <outputDirectory>${domain-lib-dir}
                                    </outputDirectory>
                                    <destFileName>${domain-jar}</destFileName>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.0.3</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.9</version>
                <configuration>
                    <systemPropertyVariables>
                        <domainJar>${domain-lib-dir}/${domain-jar}</domainJar>
                    </systemPropertyVariables>
                    <includes>
                        <include>**/annotation//*Test.java</include>
                    </includes>
                </configuration>
            </plugin>

        </plugins>
    </build>


</project>
