<?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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>io.redlink</groupId>
        <artifactId>private-parent</artifactId>
        <version>1</version>
        <relativePath />
    </parent>

    <groupId>io.redlink.nlp</groupId>
    <artifactId>redlink-nlp</artifactId>
    <version>2.0.0-SNAPSHOT</version>

    <name>Redlink NLP Modules</name>
    <description>Collection of useful modules related to natural language processing</description>
    <url>https://bitbucket.org/redlinkgmbh/redlink-nlp</url>
    <inceptionYear>2016</inceptionYear>

    <packaging>pom</packaging>
    
    <properties>

      <maven.compiler.source>1.8</maven.compiler.source>
      <maven.compiler.target>1.8</maven.compiler.target>
      <project.build.encoding>utf8</project.build.encoding>
      <project.build.sourceEncoding>utf8</project.build.sourceEncoding>
      
      <java.version>1.8</java.version>
      
      <!-- per default run all test groups-->
      <!-- see low-mem-tests profile -->
      <junit.testgroup>all</junit.testgroup>
      
      <!-- Redlink internal dependencies -->
      <rupi.version>1.0.0</rupi.version>
      <jacob.version>2.0.0-SNAPSHOT</jacob.version>
      <vispdfex.version>1.0.0-SNAPSHOT</vispdfex.version>
      <solrlib.version>0.3.0-SNAPSHOT</solrlib.version>

      <spring.version>4.1.4.RELEASE</spring.version>
      <spring.boot.version>1.3.5.RELEASE</spring.boot.version>
      <spring.data.version>1.11.4.RELEASE</spring.data.version>
      <!-- springfox.version>2.4.0</springfox.version -->

      <http.client.version>4.5.12</http.client.version>
      <commons.math.version>3.5</commons.math.version>
      <commons.io.version>2.4</commons.io.version>
      <jackson.version>2.8.3</jackson.version>

      <solr.version>6.1.0</solr.version>

      <!-- Apache Tika and related libraries versions -->
      <tika.version>1.14</tika.version>
      <pdfbox.version>2.0.3</pdfbox.version> <!-- needs to be in sync with tika -->
      <txtmark.version>0.13</txtmark.version>
      <bouncycastle.version>1.54</bouncycastle.version>


      <!-- Logging versions -->
      <slf4j.version>1.7.21</slf4j.version>
      <logback.version>1.1.7</logback.version>
      <junit.version>4.12</junit.version>
      <hamcrest.version>1.3</hamcrest.version>
      
    </properties>

    <modules>
        <module>api</module>
        <module>nlp-model</module>
        
        <!-- content processors -->
        <module>tika</module>
        <module>doc2pdf</module> <!-- uses soffice headless to convert docs to pdf -->
        <module>ocr-jacob</module> <!-- jacob wrapps tesseract -->
        <module>pdf-vistitle</module> <!-- vispdfex title extraction -->
        
        <!-- Modules providing NLP processors-->
        <module>langdetect</module>
        <module>nlp-opennlp</module>
        <module>nlp-opennlp-default</module>
        <module>nlp-opennlp-en</module>
        <module>nlp-opennlp-de</module>
        <module>nlp-opennlp-es</module>
        <module>nlp-opennlp-it</module>
        <module>nlp-stanfordnlp</module>
        <module>nlp-stanfordnlp-de</module>
        <module>nlp-truecase-de</module>
        <module>nlp-stanza</module>
        <module>nlp-stemmer</module>
        <module>nlp-stemmer-snowball</module>
        <module>nlp-stemmer-lucene</module>
        <module>nlp-stopword</module>
        <module>nlp-negation</module>
        <module>ner</module>
        <module>ner-opennlp</module>
        <module>ner-opennlp-en</module>
        <module>ner-opennlp-de</module>
        <module>ner-opennlp-es</module>
        <module>ner-opennlp-it</module>
        <module>ner-regex</module>
        <module>duckling-time</module>

        <!-- processor impl. that are no components -->
        <module>entitylinking-solr</module> <!-- entity linking against Solr -->
        
        <!-- higher level componentes -->
        <module>keyword-core</module>
        <module>keyword-textrank</module>

        <module>utils</module>
    </modules>

    <organization>
        <name>Redlink GmbH</name>
        <url>http://redlink.co</url>
    </organization>
    
    <developers>
      <developer>
        <name>Rupert Westenthaler</name>
        <email>rupert.westenthaler@redlink.co</email>
        <organization>RedLink GmbH</organization>
      </developer>
    </developers>
    
    <scm>
      <connection>scm:git:https://bitbucket.org/redlinkgmbh/redlink-nlp.git</connection>
      <developerConnection>scm:git:git@bitbucket.org:redlinkgmbh/redlink-nlp.git</developerConnection>
      <url>https://bitbucket.org/redlinkgmbh/redlink-nlp/src</url>
      <tag>HEAD</tag>
    </scm>
    
    <repositories>
      <repository>
        <id>redlink.nexus</id>
        <url>https://repo.redlink.io/mvn/content/groups/private/</url>
        <snapshots><enabled>true</enabled></snapshots>
        <releases><enabled>true</enabled></releases>
      </repository>
    </repositories>


    <distributionManagement>
      <repository>
        <id>redlink.releases</id>
        <name>RedLink Releases</name>
        <url>https://repo.redlink.io/mvn/content/repositories/redlink/</url>
      </repository>
      <snapshotRepository>
        <id>redlink.snapshots</id>
        <name>RedLink Snapshots</name>
        <url>https://repo.redlink.io/mvn/content/repositories/redlink-snapshots/</url>
      </snapshotRepository>
    </distributionManagement>
    
    <dependencyManagement>
      <dependencies>
        <dependency>
          <groupId>io.redlink.rupi</groupId>
          <artifactId>rupi</artifactId>
          <version>${rupi.version}</version>
        </dependency>
        <dependency>
          <groupId>io.redlink.jacob</groupId>
          <artifactId>jacob</artifactId>
          <version>${jacob.version}</version>
        </dependency>
        <dependency>
          <groupId>io.redlink.vispdfex</groupId>
          <artifactId>pdf-title</artifactId>
          <version>${vispdfex.version}</version>
        </dependency>
        <dependency>
          <groupId>io.redlink.solrlib</groupId>
          <artifactId>solrlib-api</artifactId>
          <version>${solrlib.version}</version>
        </dependency>


        <!-- NLP related dependencies -->
        <dependency>
          <groupId>org.apache.opennlp</groupId>
          <artifactId>opennlp-maxent</artifactId>
          <version>3.0.3</version>
        </dependency>
        <dependency>
          <groupId>org.apache.opennlp</groupId>
          <artifactId>opennlp-tools</artifactId>
          <version>1.6.0</version>
        </dependency>
        <dependency>
          <groupId>eus.ixa</groupId>
          <artifactId>ixa-pipe-nerc</artifactId>
          <version>1.6.1</version>
          <exclusions>
            <exclusion>
              <groupId>eus.ixa</groupId>
              <artifactId>ixa-pipe-pos</artifactId>
            </exclusion>
          </exclusions>
        </dependency>
        <dependency>
          <groupId>eus.ixa</groupId>
          <artifactId>ixa-pipe-pos</artifactId>
          <version>1.5.3</version>
        </dependency>
        <dependency>
          <groupId>eus.ixa</groupId>
          <artifactId>ixa-pipe-tok</artifactId>
          <version>1.8.6</version>
        </dependency>
        <dependency>
          <groupId>edu.stanford.nlp</groupId>
          <artifactId>stanford-corenlp</artifactId>
          <version>3.8.0</version>
          <exclusions>
            <exclusion>
              <groupId>org.apache.lucene</groupId>  
              <artifactId>lucene-analyzers-common</artifactId>
            </exclusion>
            <exclusion>
              <groupId>org.apache.lucene</groupId>  
              <artifactId>lucene-core</artifactId>
            </exclusion>
            <exclusion>
              <groupId>org.apache.lucene</groupId>  
              <artifactId>lucene-queries</artifactId>
            </exclusion>
            <exclusion>
              <groupId>org.apache.lucene</groupId>  
              <artifactId>lucene-queryparser</artifactId>
            </exclusion>
          </exclusions>
        </dependency>
        <dependency>
          <groupId>edu.stanford.nlp</groupId>
          <artifactId>stanford-corenlp</artifactId>
          <classifier>models-german</classifier>
          <version>3.8.0</version>
          <exclusions>
            <exclusion>
              <groupId>org.apache.lucene</groupId>  
              <artifactId>lucene-analyzers-common</artifactId>
            </exclusion>
            <exclusion>
              <groupId>org.apache.lucene</groupId>  
              <artifactId>lucene-core</artifactId>
            </exclusion>
            <exclusion>
              <groupId>org.apache.lucene</groupId>  
              <artifactId>lucene-queries</artifactId>
            </exclusion>
            <exclusion>
              <groupId>org.apache.lucene</groupId>  
              <artifactId>lucene-queryparser</artifactId>
            </exclusion>
          </exclusions>
        </dependency>
        
        <!-- Snowball -->
        <dependency> <!-- an alternative to lucene-analyzer-commons -->
          <groupId>com.github.rholder</groupId>
          <artifactId>snowball-stemmer</artifactId>
          <version>1.3.0.581.1</version>
        </dependency>
        <!-- Solr / Lucene -->
        <dependency>
          <groupId>org.apache.lucene</groupId>
          <artifactId>lucene-analyzers-common</artifactId>
          <version>${solr.version}</version>
        </dependency>
        <dependency>
          <groupId>io.redlink.solr</groupId>
          <artifactId>solrj-text-tagger</artifactId>
          <version>1.0.0</version>
        </dependency>

        <!-- Apache Tika -->
        <dependency>
            <groupId>org.apache.tika</groupId>
            <artifactId>tika-core</artifactId>
            <version>${tika.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.tika</groupId>
            <artifactId>tika-parsers</artifactId>
            <version>${tika.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.pdfbox</groupId>
            <artifactId>pdfbox</artifactId>
            <version>${pdfbox.version}</version>
        </dependency>
        <dependency> <!-- mardown parser SEARCH-417 -->
            <groupId>com.github.rjeschke</groupId>
            <artifactId>txtmark</artifactId>
            <version>${txtmark.version}</version>
        </dependency>
        <dependency> <!-- BouncyCastle (encrypted PDF support-->
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcmail-jdk15on</artifactId>
            <version>${bouncycastle.version}</version>
        </dependency>
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcprov-jdk15on</artifactId>
            <version>${bouncycastle.version}</version>
        </dependency>
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcpg-jdk15on</artifactId>
            <version>${bouncycastle.version}</version>
        </dependency>
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcpkix-jdk15on</artifactId>
            <version>${bouncycastle.version}</version>
        </dependency>
        
        
        <!-- Commons dependencies -->
        <dependency>
          <groupId>org.apache.commons</groupId>
          <artifactId>commons-lang3</artifactId>
          <version>3.4</version>
        </dependency>
        <dependency>
          <groupId>org.apache.commons</groupId>
          <artifactId>commons-collections4</artifactId>
          <version>4.1</version>
        </dependency>
        <dependency>
          <groupId>commons-io</groupId>
          <artifactId>commons-io</artifactId>
          <version>2.5</version>
        </dependency>
        <dependency>
          <groupId>org.apache.commons</groupId>
          <artifactId>commons-compress</artifactId>
          <version>1.12</version>
        </dependency>
        <dependency> <!-- for the Main (command line utility) -->
          <groupId>commons-cli</groupId>
          <artifactId>commons-cli</artifactId>
          <version>1.3.1</version>
        </dependency>
        <dependency>
          <groupId>org.apache.commons</groupId>
          <artifactId>commons-csv</artifactId>
          <version>1.2</version>
        </dependency>
        <dependency>
          <groupId>commons-codec</groupId>
          <artifactId>commons-codec</artifactId>
          <version>1.10</version>
        </dependency>
        <dependency>
          <groupId>org.apache.commons</groupId>
          <artifactId>commons-math3</artifactId>
          <version>3.6.1</version>
        </dependency>
        <dependency>
          <groupId>org.apache.httpcomponents</groupId>
          <artifactId>httpclient</artifactId>
          <version>4.5.12</version>
        </dependency>
        <dependency>
          <groupId>com.google.guava</groupId>
          <artifactId>guava</artifactId>
          <version>19.0</version>
        </dependency>
        <dependency>
          <groupId>org.jsoup</groupId>
          <artifactId>jsoup</artifactId>
          <version>1.9.2</version>
        </dependency>
        <dependency> <!-- for parsing dates form property values -->
          <groupId>joda-time</groupId>
          <artifactId>joda-time</artifactId>
          <version>2.9.5</version>
        </dependency>


        <!--
         Jackson is used for parsing/serialization models to JSON
         -->
        <dependency>
          <groupId>com.fasterxml.jackson.core</groupId>
          <artifactId>jackson-annotations</artifactId>
          <version>${jackson.version}</version>
        </dependency>
        <dependency>
          <groupId>com.fasterxml.jackson.core</groupId>
          <artifactId>jackson-core</artifactId>
          <version>${jackson.version}</version>
        </dependency>
        <dependency>
          <groupId>com.fasterxml.jackson.core</groupId>
          <artifactId>jackson-databind</artifactId>
          <version>${jackson.version}</version>
        </dependency>

        <!-- Logging -->
        <dependency>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-api</artifactId>
          <version>${slf4j.version}</version>
        </dependency>
        <dependency>
          <groupId>org.slf4j</groupId>
          <artifactId>log4j-over-slf4j</artifactId>
          <version>${slf4j.version}</version>
        </dependency>
        <dependency>
          <groupId>org.slf4j</groupId>
          <artifactId>jcl-over-slf4j</artifactId>
          <version>${slf4j.version}</version>
        </dependency>
        <dependency> <!-- simple logging for testing or CL tools -->
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-simple</artifactId>
          <version>${slf4j.version}</version>
        </dependency>
        
        <dependency>
          <groupId>ch.qos.logback</groupId>
          <artifactId>logback-core</artifactId>
          <version>${logback.version}</version>
        </dependency>
        <dependency>
          <groupId>ch.qos.logback</groupId>
          <artifactId>logback-classic</artifactId>
          <version>${logback.version}</version>
        </dependency>
        <!-- Testing -->
        <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <version>${junit.version}</version>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>com.github.ferstl</groupId>
          <artifactId>junit-testgroups</artifactId>
          <version>1.0.1</version>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.hamcrest</groupId>
          <artifactId>hamcrest-core</artifactId>
          <version>${hamcrest.version}</version>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.hamcrest</groupId>
          <artifactId>hamcrest-library</artifactId>
          <version>${hamcrest.version}</version>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </dependencyManagement>

    <build>
      <pluginManagement>
        <plugins>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.19.1</version>
            <configuration>
                <systemPropertyVariables>
                    <testgroup>${junit.testgroup}</testgroup>
                </systemPropertyVariables>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.6.1</version>
            <configuration>
              <source>${maven.compiler.source}</source>
              <target>${maven.compiler.target}</target>
              <encoding>${project.build.sourceEncoding}</encoding>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.10.4</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <phase>verify</phase>
                <goals>
                  <goal>jar</goal>
                </goals>
                <configuration>
                  <source>8</source>
                  <additionalparam>${javadoc.opts}</additionalparam>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.0.1</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <phase>verify</phase>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-jar-plugin</artifactId>
            <version>3.0.2</version>
            <executions>
                <execution>
                    <goals>
                        <goal>test-jar</goal>
                    </goals>
                </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-install-plugin</artifactId>
            <version>2.5.2</version>
          </plugin>
          <plugin>
            <artifactId>maven-deploy-plugin</artifactId>
            <version>2.8.2</version>
          </plugin>
          <plugin>
            <artifactId>maven-release-plugin</artifactId>
            <version>2.5.3</version>
            <configuration>
              <pushChanges>false</pushChanges>
              <autoVersionSubmodules>true</autoVersionSubmodules>
              <tagNameFormat>${project.artifactId}-@{project.version}</tagNameFormat>
              <localCheckout>true</localCheckout>
              <connectionUrl>scm:git:file://${project.basedir}/../../</connectionUrl>
              <indentSize>4</indentSize>
            </configuration>
          </plugin>
          <plugin> <!-- only for westei that still uses this to generate ecliple projects metadata -->
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-eclipse-plugin</artifactId>
            <version>2.10</version>
            <configuration>
              <sourceExcludes>
                <sourceExclude>DEPENDENCIES-BY-LICENSE</sourceExclude>
              </sourceExcludes>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.complykit</groupId>
            <artifactId>license-check-maven-plugin</artifactId>
            <version>0.5.3</version>
            <configuration>
              <blacklist>
                <param>agpl-3.0</param>
                <param>gpl-2.0</param>
                <param>gpl-3.0</param>
              </blacklist>
              <excludes>
                <!-- null license, although AL2 -->
                <param>org.springframework.boot:spring-boot-starter-data-mongodb:jar:${spring.data.version}</param>
                <param>org.springframework.boot:spring-data-mongodb:jar:${spring.data.version}</param>
                <param>org.springframework.boot:spring-data-mongodb-parent:jar:${spring.data.version}</param>
              </excludes>
            </configuration>
          </plugin>
        </plugins>
      </pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-javadoc-plugin</artifactId>
        </plugin>
        <plugin>
          <artifactId>maven-source-plugin</artifactId>
        </plugin>
        <plugin>
          <groupId>org.complykit</groupId>
          <artifactId>license-check-maven-plugin</artifactId>
        </plugin>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
        </plugin>
      </plugins>
    </build>
    
    <dependencies>
      <!-- Spring -->
      <!-- Manny modules do define Spring Annotations. Because of that we do
       provide the according dependency to all of them. However this dependency
       is optional at runtime and only needed when running within a Spring 
       environment.-->
      <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>${spring.version}</version>
        <scope>provided</scope>
      </dependency>
       <!-- used during build time to create metadata about annotations. Not a
        runtime dependency -->
      <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-configuration-processor</artifactId>
        <version>${spring.boot.version}</version>
        <scope>provided</scope>
        <optional>true</optional>
      </dependency>
      
      
      <!-- some global test dependencies -->
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>com.github.ferstl</groupId>
        <artifactId>junit-testgroups</artifactId>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>${logback.version}</version>
        <scope>test</scope>
      </dependency>

    </dependencies>

    <profiles>
      <profile>
          <id>low-mem-tests</id>
          <activation>
              <property>
                  <name>low-mem-tests</name>
                  <value>true</value>
              </property>
          </activation>
          <properties>
              <junit.testgroup></junit.testgroup>
          </properties>
      </profile>
      <profile>
        <id>java8-doclint-disabled</id>
        <activation>
          <jdk>[1.8,)</jdk>
        </activation>
        <properties>
          <javadoc.opts>-Xdoclint:none</javadoc.opts>
        </properties>
      </profile>
      <profile>
        <!-- Quickbuild without tests -->
        <id>quick</id>
        <activation>
          <property>
            <name>quick</name>
            <value>true</value>
          </property>
        </activation>
        
        <properties>
          <skipTests>true</skipTests>
          <skipITs>true</skipITs>
        </properties>
      </profile>
    </profiles>
</project>
