<?xml version="1.0" encoding="UTF-8"?>
<!--
   Copyright 2013-2018 Immutables Authors and Contributors

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
 -->
<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>org.immutables</groupId>
  <artifactId>immutables</artifactId>
  <version>2.9.2</version>
  <packaging>pom</packaging>

  <name>${project.groupId}.${project.artifactId}</name>
  <description>
    Java annotation processing toolkit. Focus is on immutability, type safety, fluent interfaces, high-performance.
  </description>
  <url>http://immutables.org</url>

  <modules>
    <module>testing</module>
    <module>generator</module>
    <module>generator-processor</module>
    <module>generator-fixture</module>
    <module>metainf</module>
    <module>mirror</module>
    <module>annotate</module>
    <module>ordinal</module>
    <module>builder</module>
    <module>android-stub</module>
    <module>gson</module>
    <module>criteria</module>
    <module>mongo</module>
    <module>func</module>
    <module>data</module>
    <module>value-processor</module>
    <module>processor-testlib</module>
    <module>value-annotations</module>
    <module>value-fixture</module>
    <module>value</module>
    <module>serial</module>
    <module>trees</module>
    <module>encode</module>
    <module>bom</module>
  </modules>

  <organization>
    <name>The Immutables.org authors</name>
    <url>http://immutables.org</url>
  </organization>

  <developers>
    <developer>
      <id>elucash</id>
      <name>Ievgen Lukash</name>
      <email>e.lucash@gmail.com</email>
      <timezone>-5</timezone>
    </developer>
    <developer>
      <id>asereda</id>
      <name>Andrei Sereda</name>
      <email>andrei@sereda.cc</email>
      <timezone>-5</timezone>
    </developer>
  </developers>

  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
      <comments>For all code which is used at runtime</comments>
    </license>
  </licenses>

  <scm>
    <connection>scm:git:https://github.com/immutables/immutables.git</connection>
    <developerConnection>scm:git:git@github.com:immutables/immutables.git</developerConnection>
    <url>https://github.com/immutables/immutables.git</url>
  </scm>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <module.name>${project.groupId}.${project.artifactId}</module.name>
    <sonatypeOssDistMgmtSnapshotsUrl>https://oss.sonatype.org/content/repositories/snapshots/</sonatypeOssDistMgmtSnapshotsUrl>
    <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
    <!-- Shared versions -->
    <retro.version>2.7.5</retro.version>
    <errorprone.version>2.10.0</errorprone.version>
    <javac.version>9+181-r4173-1</javac.version>
    <mongo-java-driver.version>4.3.1</mongo-java-driver.version>
    <elasticsearch.version>7.1.0</elasticsearch.version>
    <reactive-streams.version>1.0.2</reactive-streams.version>
    <log4j2.version>2.17.1</log4j2.version>
    <mongo-java-server.version>1.38.0</mongo-java-server.version>
    <jackson.version>2.8.11</jackson.version>
    <jackson-databind.version>2.8.11.6</jackson-databind.version>
    <jaxb-api.version>2.3.1</jaxb-api.version>
    <junit.version>4.13.1</junit.version>
    <junit5.version>5.6.3</junit5.version>
    <hamcrest.version>1.3</hamcrest.version>
    <mockito.verion>3.12.4</mockito.verion>
    <guava.version>19.0</guava.version>
    <gson.version>2.8.8</gson.version>
    <slf4j.version>1.7.28</slf4j.version>
    <rxjava2.version>2.2.19</rxjava2.version>
    <rxjava2-extensions.version>0.20.10</rxjava2-extensions.version>
    <reactor.version>3.3.11.RELEASE</reactor.version>
    <geode.version>1.9.0</geode.version>
    <jsr305.version>3.0.1</jsr305.version>
  </properties>

  <repositories>
    <repository>
      <id>sonatype-nexus-snapshots</id>
      <name>Sonatype Nexus Snapshots</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>

  <distributionManagement>
    <snapshotRepository>
      <id>sonatype-nexus-snapshots</id>
      <name>Sonatype Nexus Snapshots</name>
      <url>${sonatypeOssDistMgmtSnapshotsUrl}</url>
    </snapshotRepository>
    <repository>
      <id>sonatype-nexus-staging</id>
      <name>Nexus Release Repository</name>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <build>
    <sourceDirectory>src</sourceDirectory>
    <testSourceDirectory>test</testSourceDirectory>
    <resources>
      <resource>
        <directory>src</directory>
        <excludes>
          <exclude>**/*.java</exclude>
        </excludes>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>test</directory>
        <excludes>
          <exclude>**/*.java</exclude>
        </excludes>
      </testResource>
    </testResources>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.1</version>
        <configuration>
          <useIncrementalCompilation>false</useIncrementalCompilation>
          <compilerArgs>
            <arg>-Xlint:unchecked</arg>
            <arg>-Xmaxerrs</arg>
            <arg>1000000</arg>
          </compilerArgs>
        </configuration>
      </plugin>
      <plugin>
        <!-- This plugin isn't strictly necessary; without it the generated
        sources are compiled just fine. It's here to make importing the project
        into Eclipse using M2Eclipse a much smoother process. Thanks to this
        configuration users won't have to manually add each generated source
        directory to the build path. -->
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>3.2.0</version>
        <executions>
          <execution>
            <id>add-source</id>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>${project.build.directory}/generated-sources/annotations</source>
              </sources>
            </configuration>
          </execution>
          <execution>
            <id>add-test-source</id>
            <goals>
              <goal>add-test-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>${project.build.directory}/generated-test-sources/test-annotations</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>1.2</version>
        <executions>
          <execution>
            <id>enforce-maven</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>(,2.1.0),(2.1.0,2.2.0),(2.2.0,)</version>
                  <message>Maven 2.1.0 and 2.2.0 produce incorrect GPG signatures and checksums respectively.</message>
                </requireMavenVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.22.2</version>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>2.1</version>
          <configuration>
            <mavenExecutorId>forked-path</mavenExecutorId>
            <useReleaseProfile>false</useReleaseProfile>
            <arguments>-Psonatype-oss-release</arguments>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.0.2</version>

          <executions>
            <execution>
              <id>default-jar</id>
              <goals>
                <goal>jar</goal>
              </goals>
              <configuration>
                <archive>
                  <addMavenDescriptor>false</addMavenDescriptor>
                  <manifestEntries>
                    <Automatic-Module-Name>${module.name}</Automatic-Module-Name>
                  </manifestEntries>
                </archive>
              </configuration>
            </execution>
            <execution>
              <id>test-jar</id>
              <goals>
                <goal>test-jar</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <profiles>
    <profile>
      <id>sonatype-oss-release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.10.4</version>
            <configuration>
              <quiet>true</quiet>
              <nonavbar>true</nonavbar>
              <notree>true</notree>
              <nocomment>true</nocomment>
              <nohelp>true</nohelp>
              <minmemory>1G</minmemory>
              <maxmemory>2G</maxmemory>
              <additionalparam>-Xdoclint:none</additionalparam>
            </configuration>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.0.1</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>lint-javadoc</id>
      <build>
        <plugins>
          <plugin>
            <!-- Used to validate/lint javadocs -->
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.10.4</version>
            <configuration>
              <quiet>true</quiet>
              <nonavbar>true</nonavbar>
              <notree>true</notree>
              <nocomment>true</nocomment>
              <nohelp>true</nohelp>
              <minmemory>1G</minmemory>
              <maxmemory>2G</maxmemory>
            </configuration>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>jdk16</id>
      <activation>
        <jdk>[16,)</jdk>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
              <fork>true</fork>
              <compilerArgs combine.children="append">
                <!-- required by parboiled -->
                <arg>-J--add-opens=java.base/java.lang=ALL-UNNAMED</arg>
                <!-- required by errorprone -->
                <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED</arg>
                <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED</arg>
                <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED</arg>
                <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED</arg>
                <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED</arg>
                <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED</arg>
                <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED</arg>
                <arg>-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED</arg>
                <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED</arg>
                <arg>-J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED</arg>
              </compilerArgs>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>jdk17</id>
      <activation>
        <jdk>[17,)</jdk>
      </activation>
      <modules>
        <module>tests-java17</module>
      </modules>
    </profile>
  </profiles>

</project>
