<?xml version="1.0" encoding="UTF-8"?>

<!--
 * See the NOTICE file distributed with this work for additional
 * information regarding copyright ownership.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<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>org.xwiki.platform</groupId>
    <artifactId>xwiki-platform-search-solr</artifactId>
    <version>7.0</version>
  </parent>
  <artifactId>xwiki-platform-search-solr-api</artifactId>
  <name>XWiki Platform - Search - Solr - API</name>
  <description>Solr engine management: configuration, indexing, listeners, script service, etc. This module does not handle the search queries</description>
  <properties>
    <!-- Name to display by the Extension Manager -->
    <xwiki.extension.name>Solr Search API</xwiki.extension.name>
    <xwiki.jacoco.instructionRatio>0.59</xwiki.jacoco.instructionRatio>
    <!-- TODO: Remove once the tests have been fixed to not output anything to the console! -->
    <xwiki.surefire.captureconsole.skip>true</xwiki.surefire.captureconsole.skip>
  </properties>
  <dependencies>
    <!-- Solr -->
    <dependency>
      <groupId>org.apache.solr</groupId>
      <artifactId>solr-solrj</artifactId>
      <version>${solr.version}</version>
      <exclusions>
        <!-- Solr is using an old version of Woodstox but we need the newer version which is used by our Cache
             module -->
        <exclusion>
          <groupId>org.codehaus.woodstox</groupId>
          <artifactId>wstx-asl</artifactId>
        </exclusion>
        <!-- XWiki uses SLF4J for logging. -->
        <exclusion>
          <groupId>log4j</groupId>
          <artifactId>log4j</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <!-- Solr is using an old version of Woodstox but we need the newer version which is used by our Cache module -->
    <dependency>
      <groupId>org.codehaus.woodstox</groupId>
      <artifactId>woodstox-core-asl</artifactId>
    </dependency>
    <!-- Embedded Solr instance. -->
    <dependency>
      <groupId>org.apache.solr</groupId>
      <artifactId>solr-core</artifactId>
    </dependency>
    <!-- Solr core depends on a different version of Restlet (than our Rest module) which we exclude and thus we need to
      pull the right version here. -->
    <dependency>
      <groupId>org.restlet.jse</groupId>
      <artifactId>org.restlet</artifactId>
    </dependency>
    <dependency>
      <groupId>org.restlet.jee</groupId>
      <artifactId>org.restlet.ext.servlet</artifactId>
    </dependency>
    <!-- Apache Commons -->
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
    </dependency>
    <!-- Apache xalan used for Solr's internal XML operations. -->
    <dependency>
      <groupId>xalan</groupId>
      <artifactId>xalan</artifactId>
    </dependency>
    <!-- XWiki dependencies -->
    <dependency>
      <groupId>org.xwiki.commons</groupId>
      <artifactId>xwiki-commons-component-api</artifactId>
      <version>${commons.version}</version>
    </dependency>
    <dependency>
      <groupId>org.xwiki.commons</groupId>
      <artifactId>xwiki-commons-environment-api</artifactId>
      <version>${commons.version}</version>
    </dependency>
    <dependency>
      <groupId>org.xwiki.platform</groupId>
      <artifactId>xwiki-platform-model</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.xwiki.platform</groupId>
      <artifactId>xwiki-platform-oldcore</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.xwiki.platform</groupId>
      <artifactId>xwiki-platform-bridge</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.xwiki.platform</groupId>
      <artifactId>xwiki-platform-query-manager</artifactId>
      <version>${project.version}</version>
    </dependency>
    <!-- Embedded in the JAR to be used as default SOLR configuration -->
    <dependency>
      <groupId>org.xwiki.platform</groupId>
      <artifactId>xwiki-platform-search-solr-server-data</artifactId>
      <version>${project.version}</version>
      <scope>provided</scope>
    </dependency>
    <!-- Testing dependencies -->
    <!-- Since we're mocking a class (XWiki) we need those -->
    <dependency>
      <groupId>org.xwiki.commons</groupId>
      <artifactId>xwiki-commons-tool-test-component</artifactId>
      <version>${commons.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <configuration>
          <excludes>
            **/DefaultSolrIndexer.java,
            **/SolrIndexEventListener.java,
            **/AbstractSolrMetadataExtractor.java
          </excludes>
        </configuration>
      </plugin>
      <!-- Attach default configuration package -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-default-configuration</id>
            <phase>process-resources</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.xwiki.platform</groupId>
                  <artifactId>xwiki-platform-search-solr-server-data</artifactId>
                  <version>${project.version}</version>
                  <type>jar</type>
                  <destFileName>xwiki-platform-search-solr-server-data.zip</destFileName>
                </artifactItem>
              </artifactItems>
              <outputDirectory>${project.build.outputDirectory}/</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
