<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.github.mallet-ml</groupId>
  <artifactId>mallet</artifactId>
  <version>2.0.9</version>
  <packaging>jar</packaging>
  <name>MAchine Learning for LanguagE Toolkit (MALLET)</name>
  <description>
    MALLET is a Java-based package for statistical natural language processing,
    document classification, clustering, topic modeling, information extraction,
    and other machine learning applications to text.
  </description>
  <url>https://github.com/raghu298/Mallet</url>
  <licenses>
    <license>
      <name>Common Public License Version 1.0</name>
      <url>http://www.eclipse.org/legal/cpl-v10.html</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <scm>
    <url>https://github.com/raghu298/Mallet</url>
    <connection>scm:git:git://github.com/raghu298/Mallet.git</connection>
    <developerConnection>scm:git:git@github.com:raghu298/Mallet.git</developerConnection>
  </scm>
  <developers>
    <developer>
      <id>david.mimno</id>
      <name>David Mimno</name>
      <email>mimno@cornell.edu</email>
    </developer>
    <developer>
      <id>gregory.druck</id>
      <name>Gregory Druck</name>
      <email>gdruck@cs.umass.edu</email>
    </developer>
  </developers>
  <properties>
    <maven.compiler.source>17</maven.compiler.source>
    <maven.compiler.target>17</maven.compiler.target>
    <encoding>UTF-8</encoding>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <error-prone.version>2.24.1</error-prone.version>
    <maven-jacoco-plugin.version>0.8.11</maven-jacoco-plugin.version>
    <maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
    <maven-source-plugin.version>2.2.1</maven-source-plugin.version>
    <maven-surefire-plugin.version>3.0.0-M3</maven-surefire-plugin.version>
  </properties>
  <build>
    <sourceDirectory>src/main/java</sourceDirectory>
    <testSourceDirectory>src/test/java</testSourceDirectory>

    <plugins>

      <!-- Compile project using Google Error-Prone -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>${maven-compiler-plugin.version}</version>
            <configuration>
                <source>17</source>
                <target>17</target>
                <showWarnings>true</showWarnings>
                <compilerArgs>
                    <arg>-Xlint:all</arg>
                </compilerArgs>
            </configuration>
        </plugin>

        <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>${maven-source-plugin.version}</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- Javadoc Generation -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.6.3</version>
            <configuration>
                <doclint>none</doclint>
                <source>17</source>
            </configuration>
            <executions>
                <execution>
                    <id>attach-javadocs</id>
                    <goals>
                        <goal>jar</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>


        <!-- Code Coverage Reports -->
        <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>${maven-jacoco-plugin.version}</version>
            <executions>
                <execution>
                    <goals>
                        <goal>prepare-agent</goal>
                    </goals>
                </execution>
                <execution>
                    <id>report</id>
                    <phase>test</phase>
                    <goals>
                        <goal>report</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
        <version>1.5</version>
        <executions>
          <execution>
            <id>sign-artifacts</id>
            <phase>verify</phase>
            <goals>
              <goal>sign</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- Unit tests -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven-surefire-plugin.version}</version>
        <configuration>
          <parallel>methods</parallel>
          <threadCount>5</threadCount>
          <skipTests>false</skipTests>
          <systemProperties>
            <property>
              <name>java.util.logging.config.file</name>
              <value>test/resources/logging.properties</value>
            </property>
          </systemProperties>
        </configuration>
      </plugin>

      <!-- Central Publishing Plugin for Maven Central -->
      <plugin>
        <groupId>org.sonatype.central</groupId>
        <artifactId>central-publishing-maven-plugin</artifactId>
        <version>0.6.0</version>
        <extensions>true</extensions>
        <configuration>
          <publishingServerId>central</publishingServerId>
          <autoPublish>true</autoPublish>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.2</version>
    </dependency>
    <dependency>
      <groupId>jgrapht</groupId>
      <artifactId>jgrapht</artifactId>
      <version>0.6.0</version>
    </dependency>
    <dependency>
      <groupId>net.sf.jwordnet</groupId>
      <artifactId>jwnl</artifactId>
      <version>1.4_rc3</version>
    </dependency>
    <dependency>
      <groupId>net.sf.trove4j</groupId>
      <artifactId>trove4j</artifactId>
      <version>2.0.2</version>
    </dependency>
    <dependency>
      <groupId>com.googlecode.matrix-toolkits-java</groupId>
      <artifactId>mtj</artifactId>
      <version>0.9.14</version>
    </dependency>
    <dependency>
      <groupId>org.jdom</groupId>
      <artifactId>jdom</artifactId>
      <version>1.1</version>
    </dependency>
  </dependencies>
  <distributionManagement>
    <snapshotRepository>
      <id>central</id>
      <url>https://central.sonatype.com/repository/maven-snapshots/</url>
    </snapshotRepository>
    <repository>
      <id>central</id>
      <url>https://central.sonatype.com/api/v1/publisher/deployments/download/</url>
    </repository>
  </distributionManagement>

  <profiles>
    <profile>
      <id>publish-on-github-packages</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-source-plugin</artifactId>
            <version>${maven-source-plugin.version}</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <phase>package</phase>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
      <distributionManagement>
        <repository>
          <id>github</id>
          <name>GitHub Packages</name>
          <url>https://maven.pkg.github.com/mimno/mallet</url>
        </repository>
      </distributionManagement>
    </profile>

      <!-- Optional Error Prone profile -->
      <profile>
          <id>errorprone</id>
          <build>
              <plugins>
                  <plugin>
                      <groupId>org.apache.maven.plugins</groupId>
                      <artifactId>maven-compiler-plugin</artifactId>
                      <version>${maven-compiler-plugin.version}</version>
                      <configuration>
                          <release>17</release>
                          <showWarnings>true</showWarnings>
                          <compilerArgs>
                              <arg>-Xplugin:ErrorProne</arg>
                              <arg>-Xep:ClassName</arg>
                              <arg>-Xep:DepAnn</arg>
                              <arg>-Xep:EmptyIf</arg>
                              <arg>-Xep:NoAllocation</arg>
                              <arg>-Xep:NumericEquality</arg>
                              <arg>-Xep:NonCanonicalStaticMemberImport</arg>
                              <arg>-Xep:PrimitiveArrayPassedToVarargsMethod</arg>
                              <arg>-Xep:StringEquality</arg>
                              <arg>-Xep:Var</arg>
                              <arg>-Xep:WildcardImport</arg>
                              <arg>-XepDisableWarningsInGeneratedCode</arg>
                          </compilerArgs>
                          <annotationProcessorPaths>
                              <path>
                                  <groupId>com.google.errorprone</groupId>
                                  <artifactId>error_prone_core</artifactId>
                                  <version>${error-prone.version}</version>
                              </path>
                          </annotationProcessorPaths>
                      </configuration>
                      <dependencies>
                          <dependency>
                              <groupId>com.google.errorprone</groupId>
                              <artifactId>error_prone_core</artifactId>
                              <version>${error-prone.version}</version>
                          </dependency>
                      </dependencies>
                  </plugin>
              </plugins>
          </build>
      </profile>


  </profiles>
</project>
