<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.worksap.nlp</groupId>
  <artifactId>sudachi</artifactId>
  <version>0.5.0</version>
  <packaging>jar</packaging>
  <name>Sudachi Japanese Morphological Analyzer</name>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <java.version>1.8</java.version>
    <dictionary.builder>com.worksap.nlp.sudachi.dictionary.DictionaryBuilder</dictionary.builder>
    <userdictionary.builder>com.worksap.nlp.sudachi.dictionary.UserDictionaryBuilder</userdictionary.builder>
    <test.dict.source.directory>${project.basedir}/src/test/dict</test.dict.source.directory>
    <sonar.host.url>https://sonarcloud.io</sonar.host.url>
    <sonar.projectKey>com.worksap.nlp.sudachi</sonar.projectKey>
    <sonar.language>java</sonar.language>
    <sonar.organization>worksapplications</sonar.organization>
    <sonar.links.homepage>https://github.com/WorksApplications/Sudachi</sonar.links.homepage>
    <sonar.links.ci>https://travis-ci.org/WorksApplications/Sudachi</sonar.links.ci>
    <sonar.links.issue>https://github.com/WorksApplications/Sudachi/issues</sonar.links.issue>
    <sonar.junit.reportsPath />
    <sonar.junit.reportPaths>${project.build.directory}/surefire-reports</sonar.junit.reportPaths>
  </properties>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.0.0-M1</version>
            <configuration>
              <source>${java.version}</source>
              <locale>en_US</locale>
              <sourceFileExcludes>
                <exclude>**/*Impl.java</exclude>
                <exclude>**/MorphemeList.java</exclude>
                <exclude>**/DoubleArrayLexicon.java</exclude>
                <exclude>**/LexiconSet.java</exclude>
                <exclude>**/CategoryTypeSet.java</exclude>
              </sourceFileExcludes>
            </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>2.2.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>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.8</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>executable-package</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>3.0.1</version>
            <executions>
              <execution>
                <id>copy</id>
                <phase>package</phase>
                <goals>
                  <goal>copy-dependencies</goal>
                </goals>
                <configuration>
                  <outputDirectory>${project.build.directory}</outputDirectory>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-assembly-plugin</artifactId>
            <executions>
              <execution>
                <phase>package</phase>
                <goals>
                  <goal>single</goal>
                </goals>
                <configuration>
                  <descriptor>src/assembly/bin.xml</descriptor>
                  <finalName>sudachi-${project.version}</finalName>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>${java.version}</source>
          <target>${java.version}</target>
          <compilerArgument>${compilerArgument}</compilerArgument>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.6.0</version>
        <executions>
          <execution>
            <id>build-system-dict-for-test</id>
            <goals>
              <goal>java</goal>
            </goals>
            <phase>process-test-resources</phase>
            <configuration>
              <mainClass>${dictionary.builder}</mainClass>
              <arguments>
                <argument>-o</argument>
                <argument>${project.build.testOutputDirectory}/system.dic</argument>
                <argument>-m</argument>
                <argument>${test.dict.source.directory}/matrix.def</argument>
                <argument>-d</argument>
                <argument>the system dictionary for the unit tests</argument>
                <argument>${test.dict.source.directory}/lex.csv</argument>
              </arguments>
            </configuration>
          </execution>
          <execution>
            <id>build-user-dict-for-test</id>
            <goals>
              <goal>java</goal>
            </goals>
            <phase>process-test-resources</phase>
            <configuration>
              <mainClass>${userdictionary.builder}</mainClass>
              <arguments>
                <argument>-o</argument>
                <argument>${project.build.testOutputDirectory}/user.dic</argument>
                <argument>-s</argument>
                <argument>${project.build.testOutputDirectory}/system.dic</argument>
                <argument>${test.dict.source.directory}/user.csv</argument>
              </arguments>
            </configuration>
          </execution>
          <execution>
            <id>build-user2-dict-for-test</id>
            <goals>
              <goal>java</goal>
            </goals>
            <phase>process-test-resources</phase>
            <configuration>
              <mainClass>${userdictionary.builder}</mainClass>
              <arguments>
                <argument>-o</argument>
                <argument>${project.build.testOutputDirectory}/user2.dic</argument>
                <argument>-s</argument>
                <argument>${project.build.testOutputDirectory}/system.dic</argument>
                <argument>${test.dict.source.directory}/user2.csv</argument>
              </arguments>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.0.2</version>
        <configuration>
          <archive>
            <manifest>
              <mainClass>com.worksap.nlp.sudachi.SudachiCommandLine</mainClass>
              <addClasspath>true</addClasspath>
            </manifest>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.sonarsource.scanner.maven</groupId>
        <artifactId>sonar-maven-plugin</artifactId>
        <version>3.6.0.1398</version>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>0.8.4</version>
      </plugin>
      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
        <version>1.23.0</version>
        <configuration>
          <java>
            <eclipse>
              <file>${basedir}/.formatter/eclipse-formatter.xml</file>
            </eclipse>
            <removeUnusedImports />
            <licenseHeader>
              <file>${basedir}/.formatter/license-header</file>
            </licenseHeader>
          </java>
        </configuration>
        <executions>
          <execution>
            <id>check-code-format</id>
            <goals>
              <goal>check</goal>
            </goals>
            <phase>process-sources</phase>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest</artifactId>
        <version>2.1</version>
        <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-library</artifactId>
      <version>2.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.glassfish</groupId>
      <artifactId>javax.json</artifactId>
      <version>1.1</version>
    </dependency>
    <dependency>
      <groupId>com.worksap.nlp</groupId>
      <artifactId>jdartsclone</artifactId>
      <version>1.2.0</version>
    </dependency>
  </dependencies>

  <url>https://github.com/WorksApplications/Sudachi</url>
  <description>Japanese morphological analyzer</description>
  <inceptionYear>2017</inceptionYear>
  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0</url>
    </license>
  </licenses>
  <organization>
    <name>Works Applications Co., Ltd.</name>
    <url>http://www.worksap.com/</url>
  </organization>
  <developers>
    <developer>
      <id>kazuma-t</id>
      <name>Kazuma TAKAOKA</name>
      <email>takaoka_k@worksap.co.jp</email>
      <timezone>Asia/Tokyo</timezone>
    </developer>
  </developers>
  <issueManagement>
    <system>GitHub Issues</system>
    <url>https://github.com/WorksApplications/Sudachi/issues</url>
  </issueManagement>
  <scm>
    <connection>scm:git:git@github.com:WorksApplications/Sudachi.git</connection>
    <developerConnection>scm:git:git@github.com:WorksApplications/Sudachi.git</developerConnection>
    <url>https://github.com/WorksApplications/Sudachi</url>
  </scm>

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