<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<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>

  <parent>
    <groupId>org.apache.tika</groupId>
    <artifactId>tika-parent</artifactId>
    <version>1.22</version>
    <relativePath>../tika-parent/pom.xml</relativePath>
  </parent>

  <artifactId>tika-server</artifactId>
  <name>Apache Tika server</name>
  <url>http://tika.apache.org/</url>

  <properties>
  </properties>

  <pluginRepositories>
    <pluginRepository>
      <id>miredot</id>
      <name>MireDot Releases</name>
      <url>https://nexus.qmino.com/content/repositories/miredot</url>
    </pluginRepository>
  </pluginRepositories>

  <dependencies>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>tika-parsers</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>tika-translate</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>tika-langdetect</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>tika-serialization</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>tika-xmp</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>net.sf.opencsv</groupId>
      <artifactId>opencsv</artifactId>
      <version>2.3</version>
    </dependency>
    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-rt-frontend-jaxrs</artifactId>
      <version>${cxf.version}</version>
      <exclusions>
        <exclusion>
          <groupId>javax.annotation</groupId>
          <artifactId>javax.annotation-api</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-rt-rs-service-description</artifactId>
      <version>${cxf.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-rt-transports-http-jetty</artifactId>
      <version>${cxf.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-rt-rs-security-cors</artifactId>
      <version>${cxf.version}</version>
    </dependency>

    <dependency>
      <groupId>commons-cli</groupId>
      <artifactId>commons-cli</artifactId>
      <version>${cli.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>${commons.lang3.version}</version>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>${commons.io.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-rt-rs-client</artifactId>
      <version>${cxf.version}</version>
    </dependency>

    <!-- logging -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>jcl-over-slf4j</artifactId>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>jul-to-slf4j</artifactId>
    </dependency>

    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>tika-core</artifactId>
      <version>${project.version}</version>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>tika-parsers</artifactId>
      <version>${project.version}</version>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <redirectTestOutputToFile>true</redirectTestOutputToFile>
          <argLine>-da -XX:+HeapDumpOnOutOfMemoryError -Xmx512m</argLine>
          <systemPropertyVariables>
            <java.util.logging.config.file>
              ${basedir}/src/main/resources/commons-logging.properties
            </java.util.logging.config.file>
          </systemPropertyVariables>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <version>${maven.shade.version}</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <createDependencyReducedPom>
                false
              </createDependencyReducedPom>
              <filters>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>META-INF/*.SF</exclude>
                    <exclude>META-INF/*.DSA</exclude>
                    <exclude>META-INF/*.RSA</exclude>
                    <exclude>META-INF/*.txt</exclude>
                    <exclude>META-INF/ASL2.0</exclude>
                    <exclude>META-INF/DEPENDENCIES</exclude>
                    <exclude>META-INF/LICENSE</exclude>
                    <exclude>META-INF/NOTICE</exclude>
                    <exclude>META-INF/README</exclude>
                    <exclude>LICENSE.txt</exclude>
                    <exclude>NOTICE.txt</exclude>
                    <exclude>CHANGES</exclude>
                    <exclude>README</exclude>
                    <exclude>builddef.lst</exclude>
                    <!-- clutter not needed in jar -->
                    <exclude>resources/grib1/nasa/README*.pdf</exclude>
                    <exclude>resources/grib1/**/readme*.txt</exclude>
                    <exclude>resources/grib2/**/readme*.txt</exclude>
                    <!-- TIKA-763: Workaround to avoid including LGPL classes -->
                    <exclude>ucar/nc2/iosp/fysat/Fysat*.class</exclude>
                    <exclude>ucar/nc2/dataset/transform/VOceanSG1*class</exclude>
                    <exclude>ucar/unidata/geoloc/vertical/OceanSG*.class</exclude>
                  </excludes>
                </filter>
              </filters>
              <transformers>
                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                  <mainClass>org.apache.tika.server.TikaServerCli</mainClass>
                </transformer>
                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
                <transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
                  <resource>META-INF/LICENSE</resource>
                  <file>target/classes/META-INF/LICENSE</file>
                </transformer>
                <transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
                  <resource>META-INF/NOTICE</resource>
                  <file>target/classes/META-INF/NOTICE</file>
                </transformer>
                <transformer implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer">
                  <resource>META-INF/DEPENDENCIES</resource>
                  <file>target/classes/META-INF/DEPENDENCIES</file>
                </transformer>
                <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                  <resource>META-INF/spring.handlers</resource>
                </transformer>
                <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                  <resource>META-INF/spring.schemas</resource>
                </transformer>
                <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                  <resource>META-INF/cxf/cxf.extension</resource>
                </transformer>
                <transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer">
                  <resource>META-INF/extensions.xml</resource>
                </transformer>
                <transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer">
                  <resource>META-INF/cxf/extensions.xml</resource>
                </transformer>
                <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                  <resource>META-INF/cxf/bus-extensions.txt</resource>
                </transformer>
                <transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer">
                  <resource>META-INF/cxf/bus-extensions.xml</resource>
                </transformer>
                <transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer">
                  <resource>META-INF/wsdl.plugin.xml</resource>
                </transformer>
                <transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer">
                  <resource>META-INF/tools.service.validator.xml</resource>
                </transformer>
                <transformer implementation="org.apache.maven.plugins.shade.resource.XmlAppendingTransformer">
                  <resource>META-INF/cxf/java2wsbeans.xml</resource>
                </transformer>
              </transformers>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.spotify</groupId>
        <artifactId>dockerfile-maven-plugin</artifactId>
        <version>1.4.10</version>
        <configuration>
          <repository>apache/tika-server</repository>
          <tag>${project.version}</tag>
          <buildArgs>
            <JAR_FILE>tika-server-${project.version}.jar</JAR_FILE>
          </buildArgs>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifestEntries>
              <Automatic-Module-Name>org.apache.tika.server</Automatic-Module-Name>
            </manifestEntries>
          </archive>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.rat</groupId>
        <artifactId>apache-rat-plugin</artifactId>
        <version>${rat.version}</version>
        <configuration>
          <excludes>
            <exclude>src/main/resources/tikaserver-version.properties</exclude>
            <exclude>src/test/resources/*</exclude>
            <exclude>README.md</exclude>
          </excludes>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>server</id>
      <build>
        <defaultGoal>test</defaultGoal>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.6.0</version>
            <executions>
              <execution>
                <phase>test</phase>
                <goals>
                  <goal>java</goal>
                </goals>
                <configuration>
                  <mainClass>org.apache.tika.server.TikaServerCli</mainClass>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>com.qmino</groupId>
            <artifactId>miredot-plugin</artifactId>
            <version>2.2-Java10</version>
            <executions>
              <execution>
                <goals>
                  <goal>restdoc</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <organizationId>c579ca2e-c194-4a14-a7f0-f39ef4ec3c2d</organizationId>
              <restModel>
                <restFramework>
                  <name>jax-rs</name>
                </restFramework>
              </restModel>
              <output>
                <html />
              </output>
              <!-- Free Miredot license key, valid until Jan 31st, 2020 https://issues.apache.org/jira/browse/TIKA-2253 -->
              <licence>cHJvamVjdHxvcmcuYXBhY2hlLnRpa2EudGlrYS1zZXJ2ZXJ8MjAyMC0wMS0zMXx0cnVlfC0xI01Dd0NGRUV5QktCTlBJbXhwLzBvaWxuak1MYkxZQW5XQWhScWdwM0c5aFdWMGpOUFA5MlNFc2pVS1FKZStRPT0=</licence>
              <!-- insert other configuration here (optional) -->
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <organization>
    <name>The Apache Software Foundation</name>
    <url>http://www.apache.org</url>
  </organization>
  <issueManagement>
    <system>JIRA</system>
    <url>https://issues.apache.org/jira/browse/TIKA</url>
  </issueManagement>
  <ciManagement>
    <system>Jenkins</system>
    <url>https://builds.apache.org/job/Tika-trunk/</url>
  </ciManagement>
</project>
