<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>net.shrine</groupId>
    <artifactId>shrine-base</artifactId>
    <version>3.3.3</version>
    <relativePath>../../pom.xml</relativePath>
  </parent>
  <groupId>net.shrine</groupId>
  <artifactId>shrine-lucene-indexer</artifactId>
  <version>3.3.3</version>
  <name>SHRINE Ontology Lucene Indexer</name>
  <dependencies>
    <dependency>
      <groupId>com.opencsv</groupId>
      <artifactId>opencsv</artifactId>
      <version>${opencsv-version}</version>
    </dependency>
    <dependency>
      <groupId>com.github.scopt</groupId>
      <artifactId>scopt_${scala-major-version}</artifactId>
      <version>${scopt-version}</version>
    </dependency>
    <dependency>
      <groupId>net.shrine</groupId>
      <artifactId>shrine-util</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.lucene</groupId>
      <artifactId>lucene-analyzers-common</artifactId>
      <version>${lucene-version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.lucene</groupId>
      <artifactId>lucene-suggest</artifactId>
      <version>${lucene-version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.lucene</groupId>
      <artifactId>lucene-queryparser</artifactId>
      <version>${lucene-version}</version>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>net.alchim31.maven</groupId>
        <artifactId>scala-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <archive>
                <manifest>
                  <mainClass>net.shrine.ontology.indexer.LuceneIndexer</mainClass>
                </manifest>
              </archive>
              <descriptorRefs>
                <descriptorRef>jar-with-dependencies</descriptorRef>
              </descriptorRefs>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>3.0.0</version>
        <executions>
          <execution>
            <id>Make suggest index</id>
            <phase>process-test-classes</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <arguments>
                <argument>-classpath</argument>
                <classpath />
                <argument>net.shrine.ontology.indexer.LuceneIndexer</argument>
                <argument>--ontology</argument>
                <argument>src/test/resources/ontology_input</argument>
                <argument>--delimiter</argument>
                <argument>\t</argument>
                <argument>--categories</argument>
                <argument>src/test/resources/category_definition.txt</argument>
                <argument>--suggest-dir</argument>
                <argument>target/test_suggest_index</argument>
                <argument>--suggest-zip</argument>
                <argument>target/test_suggest_index.zip</argument>
                <argument>--createAutoSuggest</argument>
              </arguments>
              <workingDirectory>${pom.basedir}</workingDirectory>
            </configuration>
          </execution>
          <execution>
            <id>Make search index</id>
            <phase>process-test-classes</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <arguments>
                <argument>-classpath</argument>
                <classpath />
                <argument>net.shrine.ontology.indexer.LuceneIndexer</argument>
                <argument>--ontology</argument>
                <argument>src/test/resources/ontology_input</argument>
                <argument>--delimiter</argument>
                <argument>\t</argument>
                <argument>--categories</argument>
                <argument>src/test/resources/category_definition.txt</argument>
                <argument>--search-dir</argument>
                <argument>target/test_lucene_index</argument>
                <argument>--search-zip</argument>
                <argument>target/test_lucene_index.zip</argument>
              </arguments>
              <workingDirectory>${pom.basedir}</workingDirectory>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <executable>java</executable>
          <workingDirectory>${pom.basedir}</workingDirectory>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
