<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>io.restx</groupId>
        <artifactId>restx-parent</artifactId>
        <version>1.0.0-rc1</version>
    </parent>
    <artifactId>restx-annotation-processor-tests-java8</artifactId>
    <properties>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
    </properties>
    <dependencies>
        <dependency>
            <groupId>io.restx</groupId>
            <artifactId>restx-core-annotation-processor</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.truth</groupId>
            <artifactId>truth</artifactId>
            <version>1.1.3</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.google.testing.compile</groupId>
            <artifactId>compile-testing</artifactId>
            <version>0.21.0</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>com.sun</groupId>
                    <artifactId>tools</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>io.restx</groupId>
            <artifactId>restx-factory-annotation-processor</artifactId>
        </dependency>
    </dependencies>
    <profiles>
        <profile>
            <id>tools-jar</id>
            <activation>
                <activeByDefault>false</activeByDefault>
                <file>
                    <exists>${java.home}/../lib/tools.jar</exists>
                </file>
            </activation>
        </profile>
        <profile>
            <!-- when using eclipse and defining a jdk folder to be the home instead of the jre folder -->
            <id>jdk-tools-jar</id>
            <activation>
                <activeByDefault>false</activeByDefault>
                <file>
                    <exists>${java.home}/lib/tools.jar</exists>
                </file>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>com.sun</groupId>
                    <artifactId>tools</artifactId>
                    <version>${java.version}</version>
                    <scope>system</scope>
                    <systemPath>${java.home}/lib/tools.jar</systemPath>
                </dependency>
            </dependencies>
        </profile>
    </profiles>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <argLine>
                        --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
                        --add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
                        --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
                    </argLine>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>