<?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>standalone</artifactId>
    <groupId>com.kohlschutter.jdk.compiler</groupId>
    <version>1.1.2</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>standalone-jdk21</artifactId>
  <licenses>
    <license>
      <name>GPL-2.0-with-classpath-exception</name>
      <url>https://www.gnu.org/software/classpath/license.html</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <build>
    <plugins>
      <plugin>
        <groupId>de.thetaphi</groupId>
        <artifactId>forbiddenapis</artifactId>
        <executions>
          <execution>
            <phase>skip</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <executions>
          <execution>
            <id>checkstyle-during-compile</id>
            <phase>skip</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-pmd-plugin</artifactId>
        <executions>
          <execution>
            <id>default-check</id>
            <phase>skip</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
          <execution>
            <id>default-cpd-check</id>
            <phase>skip</phase>
            <goals>
              <goal>cpd-check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.github.spotbugs</groupId>
        <artifactId>spotbugs-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>spotbugs-during-install</id>
            <phase>skip</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <executions>
          <execution>
            <id>java21-compile</id>
            <goals>
              <goal>compile</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.outputDirectory}/META-INF/versions/21</outputDirectory>
              <release>21</release>
              <multiReleaseOutput>false</multiReleaseOutput>
              <compileSourceRoots>
                <compileSourceRoot>${project.basedir}/src/main/java21</compileSourceRoot>
              </compileSourceRoots>
            </configuration>
          </execution>
          <execution>
            <id>java18-compile</id>
            <goals>
              <goal>compile</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.outputDirectory}/META-INF/versions/18</outputDirectory>
              <release>18</release>
              <multiReleaseOutput>false</multiReleaseOutput>
              <compileSourceRoots>
                <compileSourceRoot>${project.basedir}/src/main/java18</compileSourceRoot>
              </compileSourceRoots>
            </configuration>
          </execution>
          <execution>
            <id>java16-compile</id>
            <goals>
              <goal>compile</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.outputDirectory}/META-INF/versions/16</outputDirectory>
              <release>16</release>
              <multiReleaseOutput>false</multiReleaseOutput>
              <compileSourceRoots>
                <compileSourceRoot>${project.basedir}/src/main/java16</compileSourceRoot>
              </compileSourceRoots>
            </configuration>
          </execution>
          <execution>
            <id>java15-compile</id>
            <goals>
              <goal>compile</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.outputDirectory}/META-INF/versions/15</outputDirectory>
              <release>15</release>
              <multiReleaseOutput>false</multiReleaseOutput>
              <compileSourceRoots>
                <compileSourceRoot>${project.basedir}/src/main/java15</compileSourceRoot>
              </compileSourceRoots>
            </configuration>
          </execution>
          <execution>
            <id>java14-compile</id>
            <goals>
              <goal>compile</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.outputDirectory}/META-INF/versions/14</outputDirectory>
              <release>14</release>
              <multiReleaseOutput>false</multiReleaseOutput>
              <compileSourceRoots>
                <compileSourceRoot>${project.basedir}/src/main/java14</compileSourceRoot>
              </compileSourceRoots>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <id>jar-with-dependencies</id>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <shadedArtifactAttached>true</shadedArtifactAttached>
              <shadedClassifierName>jar-with-dependencies</shadedClassifierName>
              <transformers>
                <transformer>
                  <mainClass>standalone.com.sun.tools.javac.Main</mainClass>
                </transformer>
                <transformer />
              </transformers>
              <minimizeJar>false</minimizeJar>
              <filters>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>/logging.properties</exclude>
                    <exclude>META-INF/LICENSE</exclude>
                    <exclude>META-INF/*.md</exclude>
                    <exclude>META-INF/*.MF</exclude>
                    <exclude>META-INF/*.SF</exclude>
                    <exclude>META-INF/*.DSA</exclude>
                    <exclude>META-INF/*.RSA</exclude>
                    <exclude>META-INF/*.kotlin_module</exclude>
                  </excludes>
                </filter>
              </filters>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>native</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.graalvm.buildtools</groupId>
            <artifactId>native-maven-plugin</artifactId>
            <extensions>true</extensions>
            <executions>
              <execution>
                <id>build-native</id>
                <phase>package</phase>
                <goals>
                  <goal>compile-no-fork</goal>
                </goals>
                <configuration>
                  <mainClass>standalone.com.sun.tools.javac.Main</mainClass>
                </configuration>
              </execution>
            </executions>
            <configuration>
              <skip>false</skip>
              <useArgFile>false</useArgFile>
              <imageName>${project.name}-${project.version}-javac</imageName>
              <fallback>false</fallback>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <dependencies>
    <dependency>
      <groupId>com.kohlschutter</groupId>
      <artifactId>compiler-annotations</artifactId>
      <version>1.6.4</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>
  <properties>
    <maven.compiler.release>11</maven.compiler.release>
    <spotbugs.disabled>true</spotbugs.disabled>
    <maven.compile.encoding>UTF-8</maven.compile.encoding>
    <javadoc.strict>false</javadoc.strict>
    <xlint.compiler.arg>-Xlint:none</xlint.compiler.arg>
    <project.build.resourceEncoding>UTF-8</project.build.resourceEncoding>
    <file.encoding>UTF-8</file.encoding>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
</project>
