<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.kohlschutter.jdk.compiler</groupId>
        <artifactId>compiler-home</artifactId>
        <version>1.1.0</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <groupId>com.kohlschutter.jdk</groupId>
    <artifactId>standalone-home</artifactId>
    <properties>
        <maven.compiler.release>11</maven.compiler.release>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.build.resourceEncoding>UTF-8</project.build.resourceEncoding>
        <file.encoding>UTF-8</file.encoding>
        <maven.compile.encoding>UTF-8</maven.compile.encoding>
        <xlint.compiler.arg>-Xlint:none</xlint.compiler.arg>
        <spotbugs.disabled>true</spotbugs.disabled>
        <javadoc.strict>false</javadoc.strict>

        <javahome.dir></javahome.dir>
    </properties>

    <profiles>
        <profile>
            <id>classifier</id>
            <activation>
                <property>
                    <name>classifier</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <?m2e ignore?>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <version>3.1.0</version>
                        <executions>
                            <execution>
                                <id>extract-modules</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>java</goal>
                                </goals>
                                <configuration>
                                    <mainClass>
                                        com.kohlschutter.jdk.buildutil.JavaHomeExtractor</mainClass>
                                    <workingDirectory>/tmp</workingDirectory>
                                    <arguments>
                                        <argument>${javahome.dir}</argument>
                                        <argument>
                                            ${project.build.directory}/classes-${classifier}</argument>
                                    </arguments>
                                    <includePluginDependencies>true</includePluginDependencies>
                                    <executableDependency>
                                        <groupId>com.kohlschutter.jdk</groupId>
                                        <artifactId>build-util</artifactId>
                                    </executableDependency>
                                </configuration>
                            </execution>
                        </executions>
                        <dependencies>
                            <dependency>
                                <groupId>com.kohlschutter.jdk</groupId>
                                <artifactId>build-util</artifactId>
                                <version>${project.version}</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                    <plugin>
                        <artifactId>maven-resources-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>copy-classifier</id>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <phase>compile</phase>
                                <configuration>
                                    <outputDirectory>
                                        ${project.build.directory}/classes-${classifier}</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>
                                                ${project.build.directory}/classes</directory>
                                            <includes>
                                                <include>**</include>
                                            </includes>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-jar-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>classifier-jar</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                                <configuration>
                                    <classifier>${classifier}</classifier>
                                    <classesDirectory>
                                        ${project.build.directory}/classes-${classifier}</classesDirectory>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>jdk11</id>
            <activation>
                <property>
                    <name>jdk11.home</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <?m2e ignore?>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <version>3.1.0</version>
                        <executions>
                            <execution>
                                <id>extract-modules-jdk11</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>java</goal>
                                </goals>
                                <configuration>
                                    <mainClass>
                                        com.kohlschutter.jdk.buildutil.JavaHomeExtractor</mainClass>
                                    <workingDirectory>/tmp</workingDirectory>
                                    <arguments>
                                        <argument>${jdk11.home}</argument>
                                        <argument>
                                            ${project.build.directory}/classes-jdk11</argument>
                                    </arguments>
                                    <includePluginDependencies>true</includePluginDependencies>
                                    <executableDependency>
                                        <groupId>com.kohlschutter.jdk</groupId>
                                        <artifactId>build-util</artifactId>
                                    </executableDependency>
                                </configuration>
                            </execution>
                        </executions>
                        <dependencies>
                            <dependency>
                                <groupId>com.kohlschutter.jdk</groupId>
                                <artifactId>build-util</artifactId>
                                <version>${project.version}</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                    <plugin>
                        <artifactId>maven-resources-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>copy-jdk11</id>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <phase>compile</phase>
                                <configuration>
                                    <outputDirectory>
                                        ${project.build.directory}/classes-jdk11</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>
                                                ${project.build.directory}/classes</directory>
                                            <includes>
                                                <include>**</include>
                                            </includes>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-jar-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>classifier-jdk11</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                                <configuration>
                                    <classifier>jdk11</classifier>
                                    <classesDirectory>
                                        ${project.build.directory}/classes-jdk11</classesDirectory>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>jdk21</id>
            <activation>
                <property>
                    <name>jdk21.home</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <?m2e ignore?>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <version>3.1.0</version>
                        <executions>
                            <execution>
                                <id>extract-modules-jdk21</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>java</goal>
                                </goals>
                                <configuration>
                                    <mainClass>
                                        com.kohlschutter.jdk.buildutil.JavaHomeExtractor</mainClass>
                                    <workingDirectory>/tmp</workingDirectory>
                                    <arguments>
                                        <argument>${jdk21.home}</argument>
                                        <argument>
                                            ${project.build.directory}/classes-jdk21</argument>
                                    </arguments>
                                    <includePluginDependencies>true</includePluginDependencies>
                                    <executableDependency>
                                        <groupId>com.kohlschutter.jdk</groupId>
                                        <artifactId>build-util</artifactId>
                                    </executableDependency>
                                </configuration>
                            </execution>
                        </executions>
                        <dependencies>
                            <dependency>
                                <groupId>com.kohlschutter.jdk</groupId>
                                <artifactId>build-util</artifactId>
                                <version>${project.version}</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                    <plugin>
                        <artifactId>maven-resources-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>copy-jdk21</id>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <phase>compile</phase>
                                <configuration>
                                    <outputDirectory>
                                        ${project.build.directory}/classes-jdk21</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>
                                                ${project.build.directory}/classes</directory>
                                            <includes>
                                                <include>**</include>
                                            </includes>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-jar-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>classifier-jdk21</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                                <configuration>
                                    <classifier>jdk21</classifier>
                                    <classesDirectory>
                                        ${project.build.directory}/classes-jdk21</classesDirectory>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <id>default-jar</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <configuration>
                            <classifier></classifier>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>de.thetaphi</groupId>
                <artifactId>forbiddenapis</artifactId>
                <executions>
                    <execution>
                        <id>default</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <phase>skip</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <executions>
                    <execution>
                        <id>checkstyle-during-compile</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <phase>skip</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <executions>
                    <execution>
                        <id>default-check</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <phase>skip</phase>
                    </execution>
                    <execution>
                        <id>default-cpd-check</id>
                        <goals>
                            <goal>cpd-check</goal>
                        </goals>
                        <phase>skip</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.github.spotbugs</groupId>
                <artifactId>spotbugs-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>spotbugs-during-install</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <phase>skip</phase>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
    </dependencies>
</project>
