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

  <groupId>io.smallrye</groupId>
  <artifactId>smallrye-build-parent</artifactId>
  <version>31</version>

  <name>SmallRye: Build Parent</name>
  <description>SmallRye Build Parent POM</description>
  <url>https://smallrye.io</url>

  <inceptionYear>2018</inceptionYear>

  <packaging>pom</packaging>

  <modules>
    <module>full-parent</module>
    <module>full-parent-jakarta</module>
  </modules>

  <properties>
    <!-- Plugin versions -->
    <version.asciidoctor.plugin>2.2.1</version.asciidoctor.plugin>
    <version.compiler.plugin>3.8.1</version.compiler.plugin>
    <version.gpg.plugin>3.0.1</version.gpg.plugin>
    <version.install.plugin>2.5.2</version.install.plugin>
    <version.jar.plugin>3.2.0</version.jar.plugin>
    <version.javadoc.plugin>3.3.0</version.javadoc.plugin>
    <version.nexus.staging.plugin>1.6.8</version.nexus.staging.plugin>
    <version.release.plugin>2.5.3</version.release.plugin>
    <version.source.plugin>3.2.1</version.source.plugin>
    <version.site.plugin>3.9.1</version.site.plugin>
    <version.surefire.plugin>2.22.2</version.surefire.plugin>
    <version.smallrye.code.rules.plugin>1</version.smallrye.code.rules.plugin>
    <version.formatter.plugin>2.16.0</version.formatter.plugin>
    <version.impsort.plugin>1.6.2</version.impsort.plugin>
    <version.jacoco.plugin>0.8.7</version.jacoco.plugin>
    <version.smallrye.plugin>1.0.0</version.smallrye.plugin>
    <version.versions.plugin>2.8.1</version.versions.plugin>

    <!-- Cross plugins settings -->
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

    <!-- Sonar settings -->
    <sonar.host.url>https://sonarcloud.io</sonar.host.url>
    <sonar.organization>smallrye</sonar.organization>

    <!-- maven-compiler-plugin -->
    <maven.compiler.target>1.8</maven.compiler.target>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.testTarget>${maven.compiler.target}</maven.compiler.testTarget>
    <maven.compiler.testSource>${maven.compiler.source}</maven.compiler.testSource>

    <!-- Special version for MR JAR jdk-misc artifact -->
    <version.jdk-misc>3.Final</version.jdk-misc>
  </properties>

  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/smallrye/smallrye-parent/issues</url>
  </issueManagement>

  <developers>
    <developer>
      <id>kenfinnigan</id>
      <name>Ken Finnigan</name>
      <email>ken@kenfinnigan.me</email>
      <organization>Red Hat</organization>
      <organizationUrl>https://www.redhat.com/en</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git@github.com:smallrye/smallrye-parent.git</connection>
    <developerConnection>scm:git:git@github.com:smallrye/smallrye-parent.git</developerConnection>
    <url>https://github.com/smallrye/smallrye-parent</url>
    <tag>31</tag>
  </scm>

  <distributionManagement>
    <snapshotRepository>
      <id>oss.sonatype</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
    </snapshotRepository>
    <repository>
      <id>oss.sonatype</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.asciidoctor</groupId>
          <artifactId>asciidoctor-maven-plugin</artifactId>
          <version>${version.asciidoctor.plugin}</version>
          <configuration>
            <backend>html</backend>
            <sourceHighlighter>highlightjs</sourceHighlighter>
            <imagesDir>assets</imagesDir>
            <attributes>
              <version>${project.version}</version>
              <organization>${project.organization.name}</organization>
            </attributes>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${version.compiler.plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>${version.gpg.plugin}</version>
          <configuration>
            <gpgArguments>
              <arg>--pinentry-mode</arg>
              <arg>loopback</arg>
            </gpgArguments>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-install-plugin</artifactId>
          <version>${version.install.plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>${version.jar.plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${version.javadoc.plugin}</version>
          <configuration>
            <!-- Support for @apiNote, @implSpec, @implNote -->
            <tags>
              <tag>
                <name>apiNote</name>
                <placement>a</placement>
                <head>API Note:</head>
              </tag>
              <tag>
                <name>implSpec</name>
                <placement>a</placement>
                <head>Implementation Requirements:</head>
              </tag>
              <tag>
                <name>implNote</name>
                <placement>a</placement>
                <head>Implementation Note:</head>
              </tag>
              <tag>
                <name>param</name>
              </tag>
              <tag>
                <name>return</name>
              </tag>
              <tag>
                <name>throws</name>
              </tag>
              <tag>
                <name>since</name>
              </tag>
              <tag>
                <name>version</name>
              </tag>
              <tag>
                <name>serialData</name>
              </tag>
              <tag>
                <name>see</name>
              </tag>
            </tags>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>${version.source.plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-site-plugin</artifactId>
          <version>${version.site.plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${version.surefire.plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.sonatype.plugins</groupId>
          <artifactId>nexus-staging-maven-plugin</artifactId>
          <version>${version.nexus.staging.plugin}</version>
          <configuration>
            <stagingProgressTimeoutMinutes>15</stagingProgressTimeoutMinutes>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <version>${version.jacoco.plugin}</version>
          <configuration>
            <propertyName>jacocoArgLine</propertyName>
            <append>true</append>
            <excludes>
              <exclude>META-INF/**</exclude>
            </excludes>
          </configuration>
          <executions>
              <execution>
                  <id>prepare-agent</id>
                  <goals>
                      <goal>prepare-agent</goal>
                  </goals>
                  <phase>generate-test-resources</phase>
              </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>io.smallrye</groupId>
          <artifactId>smallrye-maven-plugin</artifactId>
          <version>${version.smallrye.plugin}</version>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <executions>
          <execution>
            <id>default-compile</id>
            <phase>compile</phase>
            <goals>
              <goal>compile</goal>
            </goals>
            <!-- Ensure that the logging generator does not generate invalid annotations -->
            <configuration>
              <compilerArgs>
                <arg>-Aorg.jboss.logging.tools.addGeneratedAnnotation=false</arg>
              </compilerArgs>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>${version.release.plugin}</version>
        <configuration>
          <autoVersionSubmodules>true</autoVersionSubmodules>
          <tagNameFormat>@{project.version}</tagNameFormat>
          <preparationGoals>verify</preparationGoals>
          <pushChanges>false</pushChanges>
          <localCheckout>true</localCheckout>
          <remoteTagging>false</remoteTagging>
          <arguments>-DskipTests ${release.arguments}</arguments>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>net.revelc.code.formatter</groupId>
        <artifactId>formatter-maven-plugin</artifactId>
        <version>${version.formatter.plugin}</version>
        <dependencies>
          <dependency>
            <groupId>io.smallrye</groupId>
            <artifactId>smallrye-code-rules</artifactId>
            <version>${version.smallrye.code.rules.plugin}</version>
          </dependency>
        </dependencies>
        <configuration>
          <configFile>io/smallrye/coderules/eclipse-format.xml</configFile>
          <skip>${format.skip}</skip>
        </configuration>
        <executions>
          <execution>
            <phase>process-sources</phase>
            <goals>
              <goal>format</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>net.revelc.code</groupId>
        <artifactId>impsort-maven-plugin</artifactId>
        <version>${version.impsort.plugin}</version>
        <configuration>
          <groups>java.,javax.,org.,com.</groups>
          <staticGroups>*</staticGroups>
          <skip>${format.skip}</skip>
          <removeUnused>true</removeUnused>
        </configuration>
        <executions>
          <execution>
            <id>sort-imports</id>
            <goals>
              <goal>sort</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>versions-maven-plugin</artifactId>
        <version>${version.versions.plugin}</version>
        <configuration>
          <generateBackupPoms>false</generateBackupPoms>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <phase>package</phase>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <extensions>true</extensions>
            <configuration>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <serverId>oss.sonatype</serverId>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- MR JAR support starts here-->

    <profile>
      <id>compile-java8-release-flag</id>
      <activation>
        <file>
          <exists>${basedir}/build-release-8</exists>
        </file>
        <jdk>[9,)</jdk>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <executions>
              <execution>
                <id>default-compile</id>
                <phase>compile</phase>
                <goals>
                  <goal>compile</goal>
                </goals>
                <configuration>
                  <release>8</release>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- This profile is manually activated by a property to include jdk-misc.jar in the base layer build. -->
    <profile>
        <id>include-jdk-misc</id>
        <activation>
            <file>
                <exists>${basedir}/build-include-jdk-misc</exists>
            </file>
            <jdk>[9,)</jdk>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>default-compile</id>
                            <phase>compile</phase>
                            <goals>
                                <goal>compile</goal>
                            </goals>
                            <configuration>
                                <release>8</release>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
      <dependencies>
        <dependency>
          <groupId>org.jboss</groupId>
          <artifactId>jdk-misc</artifactId>
          <version>${version.jdk-misc}</version>
          <optional>true</optional>
        </dependency>
      </dependencies>
    </profile>

    <!--                -->
    <!-- Java 9 support -->
    <!--                -->

    <!-- This profile is activated when the baseline JDK version running tests is Java 9 -->
    <profile>
        <id>java9-test-classpath</id>
        <activation>
            <jdk>[9,10)</jdk>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>default-test</id>
                            <configuration>
                                <classesDirectory>${project.build.outputDirectory}/META-INF/versions/9</classesDirectory>
                                <additionalClasspathElements>
                                    <additionalClasspathElement>${project.build.outputDirectory}</additionalClasspathElement>
                                </additionalClasspathElements>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </profile>

    <!-- This profile is activated when Java 9 or later is used to test a project that supports Java 8 -->
    <profile>
        <id>java8-test</id>
        <activation>
            <jdk>[9,)</jdk>
            <property>
                <name>java8.home</name>
            </property>
            <file>
                <exists>${basedir}/build-test-java8</exists>
            </file>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>java8-test</id>
                            <phase>test</phase>
                            <goals>
                                <goal>test</goal>
                            </goals>
                            <configuration>
                                <jvm>${java8.home}/bin/java</jvm>
                                <additionalClasspathElements>
                                    <additionalClasspathElement>${java8.home}/lib/tools.jar</additionalClasspathElement>
                                </additionalClasspathElements>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </profile>

    <!-- This profile is activated when Java 9 or later is used to build -->
    <profile>
        <id>java9-mr-build</id>
        <activation>
            <jdk>[9,)</jdk>
            <file>
                <exists>${basedir}/src/main/java9</exists>
            </file>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>compile-java9</id>
                            <phase>compile</phase>
                            <goals>
                                <goal>compile</goal>
                            </goals>
                            <configuration>
                                <release>9</release>
                              <compileSourceRoots>
                                <compileSourceRoot>${project.basedir}/src/main/java9</compileSourceRoot>
                              </compileSourceRoots>
                              <multiReleaseOutput>true</multiReleaseOutput>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <artifactId>maven-jar-plugin</artifactId>
                    <configuration>
                        <archive>
                            <manifestEntries>
                                <Multi-Release>true</Multi-Release>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>

    <!--                 -->
    <!-- Java 10 support -->
    <!--                 -->

    <!-- This profile is activated when the baseline JDK version running tests is Java 10 -->
    <profile>
        <id>java10-test-classpath</id>
        <activation>
            <jdk>[10,11)</jdk>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>default-test</id>
                            <configuration>
                                <classesDirectory>${project.build.outputDirectory}/META-INF/versions/10</classesDirectory>
                                <additionalClasspathElements>
                                    <additionalClasspathElement>${project.build.outputDirectory}/META-INF/versions/9</additionalClasspathElement>
                                    <additionalClasspathElement>${project.build.outputDirectory}</additionalClasspathElement>
                                </additionalClasspathElements>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </profile>

    <!-- This profile is activated when Java 10 or later is used to test a project that supports Java 9 -->
    <profile>
        <id>java9-test</id>
        <activation>
            <jdk>[10,)</jdk>
            <property>
                <name>java9.home</name>
            </property>
            <file>
                <exists>${basedir}/build-test-java9</exists>
            </file>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>java9-test</id>
                            <phase>test</phase>
                            <goals>
                                <goal>test</goal>
                            </goals>
                            <configuration>
                                <jvm>${java9.home}/bin/java</jvm>
                                <classesDirectory>${project.build.outputDirectory}/META-INF/versions/9</classesDirectory>
                                <additionalClasspathElements>
                                    <additionalClasspathElement>${project.build.outputDirectory}</additionalClasspathElement>
                                </additionalClasspathElements>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </profile>

    <!-- This profile is activated when Java 10 or later is used to build -->
    <profile>
        <id>java10-mr-build</id>
        <activation>
            <jdk>[10,)</jdk>
            <file>
                <exists>${basedir}/src/main/java10</exists>
            </file>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>compile-java10</id>
                            <phase>compile</phase>
                            <goals>
                                <goal>compile</goal>
                            </goals>
                            <configuration>
                                <release>10</release>
                              <compileSourceRoots>
                                <compileSourceRoot>${project.basedir}/src/main/java10</compileSourceRoot>
                              </compileSourceRoots>
                              <multiReleaseOutput>true</multiReleaseOutput>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <artifactId>maven-jar-plugin</artifactId>
                    <configuration>
                        <archive>
                            <manifestEntries>
                                <Multi-Release>true</Multi-Release>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>

    <!--                 -->
    <!-- Java 11 support -->
    <!--                 -->

    <!-- This profile is activated when the baseline JDK version running tests is Java 11 -->
    <profile>
        <id>java11-test-classpath</id>
        <activation>
            <jdk>[11,12)</jdk>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>default-test</id>
                            <configuration>
                                <classesDirectory>${project.build.outputDirectory}/META-INF/versions/11</classesDirectory>
                                <additionalClasspathElements>
                                    <additionalClasspathElement>${project.build.outputDirectory}/META-INF/versions/10</additionalClasspathElement>
                                    <additionalClasspathElement>${project.build.outputDirectory}/META-INF/versions/9</additionalClasspathElement>
                                    <additionalClasspathElement>${project.build.outputDirectory}</additionalClasspathElement>
                                </additionalClasspathElements>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </profile>

    <!-- This profile is activated when Java 11 or later is used to test a project that supports Java 10 -->
    <profile>
        <id>java10-test</id>
        <activation>
            <jdk>[11,)</jdk>
            <property>
                <name>java10.home</name>
            </property>
            <file>
                <exists>${basedir}/build-test-java10</exists>
            </file>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>java10-test</id>
                            <phase>test</phase>
                            <goals>
                                <goal>test</goal>
                            </goals>
                            <configuration>
                                <jvm>${java10.home}/bin/java</jvm>
                                <classesDirectory>${project.build.outputDirectory}/META-INF/versions/10</classesDirectory>
                                <additionalClasspathElements>
                                    <additionalClasspathElement>${project.build.outputDirectory}/META-INF/versions/9</additionalClasspathElement>
                                    <additionalClasspathElement>${project.build.outputDirectory}</additionalClasspathElement>
                                </additionalClasspathElements>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </profile>

    <!-- This profile is activated when Java 11 or later is used to build -->
    <profile>
        <id>java11-mr-build</id>
        <activation>
            <jdk>[11,)</jdk>
            <file>
                <exists>${basedir}/src/main/java11</exists>
            </file>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>compile-java11</id>
                            <phase>compile</phase>
                            <goals>
                                <goal>compile</goal>
                            </goals>
                            <configuration>
                                <release>11</release>
                              <compileSourceRoots>
                                <compileSourceRoot>${project.basedir}/src/main/java11</compileSourceRoot>
                              </compileSourceRoots>
                              <multiReleaseOutput>true</multiReleaseOutput>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <artifactId>maven-jar-plugin</artifactId>
                    <configuration>
                        <archive>
                            <manifestEntries>
                                <Multi-Release>true</Multi-Release>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>

    <!--                 -->
    <!-- Java 12 support -->
    <!--                 -->

    <!-- This profile is activated when the baseline JDK version running tests is Java 12 -->
    <profile>
        <id>java12-test-classpath</id>
        <activation>
            <jdk>[12,13)</jdk>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>default-test</id>
                            <configuration>
                                <classesDirectory>${project.build.outputDirectory}/META-INF/versions/12</classesDirectory>
                                <additionalClasspathElements>
                                    <additionalClasspathElement>${project.build.outputDirectory}/META-INF/versions/11</additionalClasspathElement>
                                    <additionalClasspathElement>${project.build.outputDirectory}/META-INF/versions/10</additionalClasspathElement>
                                    <additionalClasspathElement>${project.build.outputDirectory}/META-INF/versions/9</additionalClasspathElement>
                                    <additionalClasspathElement>${project.build.outputDirectory}</additionalClasspathElement>
                                </additionalClasspathElements>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </profile>

    <!-- This profile is activated when Java 12 or later is used to test a project that supports Java 11 -->
    <profile>
        <id>java11-test</id>
        <activation>
            <jdk>[12,)</jdk>
            <property>
                <name>java11.home</name>
            </property>
            <file>
                <exists>${basedir}/build-test-java11</exists>
            </file>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>java11-test</id>
                            <phase>test</phase>
                            <goals>
                                <goal>test</goal>
                            </goals>
                            <configuration>
                                <jvm>${java11.home}/bin/java</jvm>
                                <classesDirectory>${project.build.outputDirectory}/META-INF/versions/11</classesDirectory>
                                <additionalClasspathElements>
                                    <additionalClasspathElement>${project.build.outputDirectory}/META-INF/versions/10</additionalClasspathElement>
                                    <additionalClasspathElement>${project.build.outputDirectory}/META-INF/versions/9</additionalClasspathElement>
                                    <additionalClasspathElement>${project.build.outputDirectory}</additionalClasspathElement>
                                </additionalClasspathElements>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </profile>

    <!-- This profile is activated when Java 12 or later is used to build -->
    <profile>
        <id>java12-mr-build</id>
        <activation>
            <jdk>[12,)</jdk>
            <file>
                <exists>${basedir}/src/main/java12</exists>
            </file>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>compile-java12</id>
                            <phase>compile</phase>
                            <goals>
                                <goal>compile</goal>
                            </goals>
                            <configuration>
                                <release>12</release>
                              <compileSourceRoots>
                                <compileSourceRoot>${project.basedir}/src/main/java12</compileSourceRoot>
                              </compileSourceRoots>
                              <multiReleaseOutput>true</multiReleaseOutput>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <artifactId>maven-jar-plugin</artifactId>
                    <configuration>
                        <archive>
                            <manifestEntries>
                                <Multi-Release>true</Multi-Release>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>

    <!--                 -->
    <!-- Java 13 support -->
    <!--                 -->

    <!-- This profile is activated when the baseline JDK version running tests is Java 13 -->
    <profile>
        <id>java13-test-classpath</id>
        <activation>
            <jdk>[13,14)</jdk>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>default-test</id>
                            <configuration>
                                <classesDirectory>${project.build.outputDirectory}/META-INF/versions/13</classesDirectory>
                                <additionalClasspathElements>
                                    <additionalClasspathElement>${project.build.outputDirectory}/META-INF/versions/12</additionalClasspathElement>
                                    <additionalClasspathElement>${project.build.outputDirectory}/META-INF/versions/11</additionalClasspathElement>
                                    <additionalClasspathElement>${project.build.outputDirectory}/META-INF/versions/10</additionalClasspathElement>
                                    <additionalClasspathElement>${project.build.outputDirectory}/META-INF/versions/9</additionalClasspathElement>
                                    <additionalClasspathElement>${project.build.outputDirectory}</additionalClasspathElement>
                                </additionalClasspathElements>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </profile>

    <!-- This profile is activated when Java 13 or later is used to test a project that supports Java 12 -->
    <profile>
        <id>java12-test</id>
        <activation>
            <jdk>[13,)</jdk>
            <property>
                <name>java12.home</name>
            </property>
            <file>
                <exists>${basedir}/build-test-java12</exists>
            </file>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>java12-test</id>
                            <phase>test</phase>
                            <goals>
                                <goal>test</goal>
                            </goals>
                            <configuration>
                                <jvm>${java12.home}/bin/java</jvm>
                                <classesDirectory>${project.build.outputDirectory}/META-INF/versions/12</classesDirectory>
                                <additionalClasspathElements>
                                    <additionalClasspathElement>${project.build.outputDirectory}/META-INF/versions/11</additionalClasspathElement>
                                    <additionalClasspathElement>${project.build.outputDirectory}/META-INF/versions/10</additionalClasspathElement>
                                    <additionalClasspathElement>${project.build.outputDirectory}/META-INF/versions/9</additionalClasspathElement>
                                    <additionalClasspathElement>${project.build.outputDirectory}</additionalClasspathElement>
                                </additionalClasspathElements>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </profile>

    <!-- This profile is activated when Java 13 or later is used to build -->
    <profile>
        <id>java13-mr-build</id>
        <activation>
            <jdk>[13,)</jdk>
            <file>
                <exists>${basedir}/src/main/java13</exists>
            </file>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>compile-java13</id>
                            <phase>compile</phase>
                            <goals>
                                <goal>compile</goal>
                            </goals>
                            <configuration>
                                <release>13</release>
                              <compileSourceRoots>
                                <compileSourceRoot>${project.basedir}/src/main/java13</compileSourceRoot>
                              </compileSourceRoots>
                              <multiReleaseOutput>true</multiReleaseOutput>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <artifactId>maven-jar-plugin</artifactId>
                    <configuration>
                        <archive>
                            <manifestEntries>
                                <Multi-Release>true</Multi-Release>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>

    <!--                 -->
    <!-- Java 14 support -->
    <!--                 -->

    <!-- This profile is activated when the baseline JDK version running tests is Java 14 -->
    <profile>
        <id>java14-test-classpath</id>
        <activation>
            <jdk>[14,15)</jdk>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>default-test</id>
                            <configuration>
                                <classesDirectory>${project.build.outputDirectory}/META-INF/versions/14</classesDirectory>
                                <additionalClasspathElements>
                                    <additionalClasspathElement>${project.build.outputDirectory}/META-INF/versions/13</additionalClasspathElement>
                                    <additionalClasspathElement>${project.build.outputDirectory}/META-INF/versions/12</additionalClasspathElement>
                                    <additionalClasspathElement>${project.build.outputDirectory}/META-INF/versions/11</additionalClasspathElement>
                                    <additionalClasspathElement>${project.build.outputDirectory}/META-INF/versions/10</additionalClasspathElement>
                                    <additionalClasspathElement>${project.build.outputDirectory}/META-INF/versions/9</additionalClasspathElement>
                                    <additionalClasspathElement>${project.build.outputDirectory}</additionalClasspathElement>
                                </additionalClasspathElements>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </profile>

    <!-- This profile is activated when Java 14 or later is used to test a project that supports Java 13 -->
    <profile>
        <id>java13-test</id>
        <activation>
            <jdk>[14,)</jdk>
            <property>
                <name>java13.home</name>
            </property>
            <file>
                <exists>${basedir}/build-test-java13</exists>
            </file>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>java13-test</id>
                            <phase>test</phase>
                            <goals>
                                <goal>test</goal>
                            </goals>
                            <configuration>
                                <jvm>${java13.home}/bin/java</jvm>
                                <classesDirectory>${project.build.outputDirectory}/META-INF/versions/13</classesDirectory>
                                <additionalClasspathElements>
                                    <additionalClasspathElement>${project.build.outputDirectory}/META-INF/versions/12</additionalClasspathElement>
                                    <additionalClasspathElement>${project.build.outputDirectory}/META-INF/versions/11</additionalClasspathElement>
                                    <additionalClasspathElement>${project.build.outputDirectory}/META-INF/versions/10</additionalClasspathElement>
                                    <additionalClasspathElement>${project.build.outputDirectory}/META-INF/versions/9</additionalClasspathElement>
                                    <additionalClasspathElement>${project.build.outputDirectory}</additionalClasspathElement>
                                </additionalClasspathElements>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </profile>

    <!-- This profile is activated when Java 14 or later is used to build -->
    <profile>
        <id>java14-mr-build</id>
        <activation>
            <jdk>[14,)</jdk>
            <file>
                <exists>${basedir}/src/main/java14</exists>
            </file>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>compile-java14</id>
                            <phase>compile</phase>
                            <goals>
                                <goal>compile</goal>
                            </goals>
                            <configuration>
                                <release>14</release>
                              <compileSourceRoots>
                                <compileSourceRoot>${project.basedir}/src/main/java14</compileSourceRoot>
                              </compileSourceRoots>
                              <multiReleaseOutput>true</multiReleaseOutput>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <artifactId>maven-jar-plugin</artifactId>
                    <configuration>
                        <archive>
                            <manifestEntries>
                                <Multi-Release>true</Multi-Release>
                            </manifestEntries>
                        </archive>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>

    <!--                 -->
    <!-- Java 15 support -->
    <!--                 -->

    <!-- This profile is activated when the baseline JDK version running tests is Java 15 -->
    <profile>
      <id>java15-test-classpath</id>
      <activation>
        <jdk>[15,16)</jdk>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <executions>
              <execution>
                <id>default-test</id>
                <configuration>
                  <classesDirectory>${project.build.outputDirectory}/META-INF/versions/15</classesDirectory>
                  <additionalClasspathElements>
                    <additionalClasspathElement>${project.build.outputDirectory}/META-INF/versions/14</additionalClasspathElement>
                    <additionalClasspathElement>${project.build.outputDirectory}/META-INF/versions/13</additionalClasspathElement>
                    <additionalClasspathElement>${project.build.outputDirectory}/META-INF/versions/12</additionalClasspathElement>
                    <additionalClasspathElement>${project.build.outputDirectory}/META-INF/versions/11</additionalClasspathElement>
                    <additionalClasspathElement>${project.build.outputDirectory}/META-INF/versions/10</additionalClasspathElement>
                    <additionalClasspathElement>${project.build.outputDirectory}/META-INF/versions/9</additionalClasspathElement>
                    <additionalClasspathElement>${project.build.outputDirectory}</additionalClasspathElement>
                  </additionalClasspathElements>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- This profile is activated when Java 15 or later is used to test a project that supports Java 14-->
    <profile>
      <id>java14-test</id>
      <activation>
        <jdk>[15,)</jdk>
        <property>
          <name>java14.home</name>
        </property>
        <file>
          <exists>${basedir}/build-test-java14</exists>
        </file>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <executions>
              <execution>
                <id>java14-test</id>
                <phase>test</phase>
                <goals>
                  <goal>test</goal>
                </goals>
                <configuration>
                  <jvm>${java14.home}/bin/java</jvm>
                  <classesDirectory>${project.build.outputDirectory}/META-INF/versions/14</classesDirectory>
                  <additionalClasspathElements>
                    <additionalClasspathElement>${project.build.outputDirectory}/META-INF/versions/13</additionalClasspathElement>
                    <additionalClasspathElement>${project.build.outputDirectory}/META-INF/versions/12</additionalClasspathElement>
                    <additionalClasspathElement>${project.build.outputDirectory}/META-INF/versions/11</additionalClasspathElement>
                    <additionalClasspathElement>${project.build.outputDirectory}/META-INF/versions/10</additionalClasspathElement>
                    <additionalClasspathElement>${project.build.outputDirectory}/META-INF/versions/9</additionalClasspathElement>
                    <additionalClasspathElement>${project.build.outputDirectory}</additionalClasspathElement>
                  </additionalClasspathElements>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- This profile is activated when Java 15 or later is used to build -->
    <profile>
      <id>java15-mr-build</id>
      <activation>
        <jdk>[15,)</jdk>
        <file>
          <exists>${basedir}/src/main/java15</exists>
        </file>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <executions>
              <execution>
                <id>compile-java15</id>
                <phase>compile</phase>
                <goals>
                  <goal>compile</goal>
                </goals>
                <configuration>
                  <release>15</release>
                  <compileSourceRoots>
                    <compileSourceRoot>${project.basedir}/src/main/java15</compileSourceRoot>
                  </compileSourceRoots>
                  <multiReleaseOutput>true</multiReleaseOutput>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-jar-plugin</artifactId>
            <configuration>
              <archive>
                <manifestEntries>
                  <Multi-Release>true</Multi-Release>
                </manifestEntries>
              </archive>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- MR JAR support ends here-->

  </profiles>
</project>
