<?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">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.google.mug</groupId>
  <artifactId>mug-root</artifactId>
  <packaging>pom</packaging>
  <version>8.2</version>
  <name>mug-root</name>
  <description>Google Mug Library</description>
  <url>http://github.com/google/mug</url>

  <distributionManagement>
    <repository>
      <id>sonatype-nexus-staging</id>
      <name>Sonatype Nexus release repository</name>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
    <snapshotRepository>
      <id>ossrh</id>
      <name>Sonatype Nexus snapshot repository</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
    </snapshotRepository>
  </distributionManagement>

  <licenses>
    <license>
      <name>Apache License 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0</url>
    </license>
  </licenses>

  <scm>
    <url>http://github.com/google/mug</url>
    <connection>scm:git:git@github.com:google/mug.git</connection>
    <developerConnection>scm:git:git@github.com:google/mug.git</developerConnection>
    <tag>mug-root-8.2</tag>
  </scm>

  <developers>
    <developer>
      <name>Ben Yu</name>
      <roles>
      <role>Original Developer</role>
      </roles>
    </developer>
  </developers>

  <modules>
    <module>mug</module>
    <module>mug-benchmarks</module>
    <module>mug-examples</module>
    <module>mug-algorithms</module>
    <module>mug-guava</module>
    <module>mug-protobuf</module>
    <module>mug-errorprone</module>
    <module>mug-bigquery</module>
  </modules>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <powermock.version>1.6.6</powermock.version>
    <maven.javadoc.failOnError>false</maven.javadoc.failOnError>
  </properties>

  <dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.1</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <version>5.0.0-M3</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>com.google.truth</groupId>
      <artifactId>truth</artifactId>
      <version>1.1.5</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>com.google.truth.extensions</groupId>
      <artifactId>truth-java8-extension</artifactId>
      <version>1.1.5</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.testparameterinjector</groupId>
      <artifactId>test-parameter-injector</artifactId>
      <version>1.8</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>2.27.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava-testlib</artifactId>
      <version>[20.0,)</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>[20.0,)</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.errorprone</groupId>
      <artifactId>error_prone_annotation</artifactId>
      <scope>compile</scope>
      <version>2.23.0</version>
      <classifier>sources</classifier>
    </dependency>
    <dependency>
      <groupId>com.google.errorprone</groupId>
      <artifactId>error_prone_annotations</artifactId>
      <scope>compile</scope>
      <version>2.23.0</version>
      <classifier>sources</classifier>
    </dependency>
    <dependency>
      <groupId>org.checkerframework</groupId>
      <artifactId>checker-qual</artifactId>
      <version>3.12.0</version>
      <classifier>sources</classifier>
    </dependency>
  </dependencies>

  </dependencyManagement>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-release-plugin</artifactId>
          <version>3.0.0-M1</version>
          <configuration>
            <autoVersionSubmodules>true</autoVersionSubmodules>
            <useReleaseProfile>false</useReleaseProfile>
            <releaseProfiles>release</releaseProfiles>
            <goals>deploy</goals>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.8.1</version>
          <configuration>
            <fork>true</fork>
            <source>8</source>
            <target>8</target>
            <encoding>UTF-8</encoding>
            <compilerArgs>
              <arg>-XDcompilePolicy=simple</arg>
              <arg>-Xplugin:ErrorProne</arg>
              <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>
            <annotationProcessorPaths>
              <path>
                <groupId>com.google.errorprone</groupId>
                <artifactId>error_prone_core</artifactId>
                <version>2.23.0</version>
              </path>
            <!-- Other annotation processors go here.
            If 'annotationProcessorPaths' is set, processors will no longer be
            discovered on the regular -classpath; see also 'Using Error Prone
            together with other annotation processors' below. -->
            </annotationProcessorPaths>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-source-plugin</artifactId>
          <version>2.2.1</version>
        </plugin>
        <plugin>
          <artifactId>maven-clean-plugin</artifactId>
          <version>2.4.1</version>
        </plugin>
        <plugin>
          <artifactId>maven-install-plugin</artifactId>
          <version>2.3.1</version>
        </plugin>
        <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <version>2.5</version>
        </plugin>
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.22.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.1.0</version>
            <executions>
                <execution>
                    <id>javadoc-jar</id>
                    <phase>package</phase>
                    <goals>
                        <goal>jar</goal>
                    </goals>
                    <configuration>
                        <classifier>javadoc</classifier>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        <plugin>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>2.7</version>
        </plugin>
        <plugin>
          <artifactId>maven-site-plugin</artifactId>
          <version>3.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>3.6.3</version>
          <configuration>
            <sourcepath>mug/src/main/java;mug-guava/src/main/java;mug-protobuf/src/main/java;mug-bigquery/src/main/java;</sourcepath>
            <includeDependencySources>true</includeDependencySources>
            <additionalDependencies>
              <additionalDependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>33.1.0-jre</version>
              </additionalDependency>
              <additionalDependency>
                <groupId>com.google.errorprone</groupId>
                <artifactId>error_prone_annotations</artifactId>
                <version>2.23.0</version>
              </additionalDependency>
              <additionalDependency>
                <groupId>com.google.protobuf</groupId>
                <artifactId>protobuf-java</artifactId>
                <version>4.26.0</version>
              </additionalDependency>
              <additionalDependency>
                <groupId>org.checkerframework</groupId>
                <artifactId>checker-qual</artifactId>
                <version>3.12.0</version>
              </additionalDependency>
              <additionalDependency>
                <groupId>com.google.cloud</groupId>
                <artifactId>google-cloud-bigquery</artifactId>
                <version>2.34.2</version>
              </additionalDependency>
            </additionalDependencies>
          </configuration>
          <executions>
          <execution>
            <id>attach-docs</id>
            <phase>post-integration-test</phase>
            <goals><goal>jar</goal></goals>
          </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.sonatype.plugins</groupId>
          <artifactId>nexus-staging-maven-plugin</artifactId>
          <version>1.6.6</version>
          <extensions>true</extensions>
          <configuration>
          <serverId>ossrh</serverId>
          <nexusUrl>https://oss.sonatype.org/</nexusUrl>
          <autoReleaseAfterClose>true</autoReleaseAfterClose>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>
  
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
          <!-- always deploy sources on Nexus -->
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
  
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
          <doclint>none</doclint>
        </configuration>
        <executions>
          <!-- always deploy sources on Nexus -->
          <execution>
            <id>attach-docs</id>
          </execution>
          <execution>
            <id>generate-javadoc-site-report</id>
            <phase>site</phase>
            <goals>
              <goal>javadoc</goal>
            </goals>
          </execution>
          <execution>
            <id>generate-javadoc-jar</id>
            <phase>package</phase>
            <goals>
              <goal>javadoc</goal>
            </goals>
            <configuration>
                <classifier>root-javadoc</classifier>
                <show>protected</show>
                <detectLinks>true</detectLinks>
            </configuration>
          </execution>
          <execution>
            <id>generate-mug-javadoc-jar</id>
            <phase>package</phase>
            <goals>
              <goal>javadoc</goal>
            </goals>
            <configuration>
                <classifier>mug-javadoc</classifier>
                <destDir>${project.basedir}/mug</destDir>
                <show>protected</show>
                <detectLinks>true</detectLinks>
            </configuration>
          </execution>
          <execution>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <!-- Signing artifacts for maven central deployment see https://docs.sonatype.org/display/Repository/How+To+Generate+PGP+Signatures+With+Maven -->
    <profile>
      <id>release</id>
      <activation>
      <property>
        <name>performRelease</name>
        <value>true</value>
      </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.5</version>
            <configuration>
              <arguments>-Dgpg.passphrase=${gpg.passphrase}</arguments>
            </configuration>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
