<?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>org.wikimedia.discovery</groupId>
        <artifactId>discovery-parent-pom</artifactId>
        <version>1.55</version>
    </parent>

    <groupId>org.wikimedia.search</groupId>
    <artifactId>extra-analysis</artifactId>
    <version>6.8.23</version>
    <packaging>pom</packaging>
    <name>Elasticsearch extra plugins (GPL)</name>
    <description>Extra (GPL) Analysis Modules for Elasticsearch.</description>

    <licenses>
        <license>
            <name>GNU General Public License, Version 3</name>
            <url>https://www.gnu.org/licenses/gpl-3.0.en.html</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <modules>
        <module>extra-analysis-esperanto</module>
        <module>extra-analysis-serbian</module>
    </modules>

    <scm>
        <connection>scm:git:https://gerrit.wikimedia.org/r/search/extra-analysis</connection>
        <developerConnection>scm:git:ssh://gerrit.wikimedia.org:29418/search/extra-analysis</developerConnection>
        <tag>extra-analysis-6.8.23</tag>
        <url>https://gerrit.wikimedia.org/r/#/admin/projects/search/extra-analysis</url>
    </scm>

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/wikimedia/extra-analysis/issues</url>
    </issueManagement>

    <properties>
        <elasticsearch.version>6.8.23</elasticsearch.version>
        <hamcrest.version>1.3</hamcrest.version>
        <log4j.version>2.17.1</log4j.version>
        <lucene.version>7.7.3</lucene.version>
        <maven.compiler.showWarnings>true</maven.compiler.showWarnings>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <randomizedtesting.version>2.7.1</randomizedtesting.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.apache.lucene</groupId>
                <artifactId>lucene-analyzers-common</artifactId>
                <version>${lucene.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.lucene</groupId>
                <artifactId>lucene-core</artifactId>
                <version>${lucene.version}</version>
            </dependency>
            <dependency>
                <groupId>org.elasticsearch</groupId>
                <artifactId>elasticsearch</artifactId>
                <version>${elasticsearch.version}</version>
            </dependency>
            <dependency>
                <groupId>org.wikimedia.search</groupId>
                <artifactId>extra-analysis-esperanto</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.wikimedia.search</groupId>
                <artifactId>extra-analysis-serbian</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.12</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-api</artifactId>
                <version>${log4j.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-core</artifactId>
                <version>${log4j.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <!-- Must come before Elasticsearch dependency. -->
                <groupId>org.apache.lucene</groupId>
                <artifactId>lucene-test-framework</artifactId>
                <version>${lucene.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.elasticsearch.test</groupId>
                <artifactId>framework</artifactId>
                <version>${elasticsearch.version}</version>
                <scope>test</scope>
                <exclusions>
                    <exclusion>
                        <groupId>org.hamcrest</groupId>
                        <artifactId>hamcrest-all</artifactId>
                    </exclusion>
                </exclusions>
            </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>
        <resources>
            <resource>
                <filtering>true</filtering>
                <directory>src/main/resources</directory>
                <includes>
                    <include>*.properties</include>
                </includes>
            </resource>
        </resources>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.carrotsearch.randomizedtesting</groupId>
                    <artifactId>junit4-maven-plugin</artifactId>
                    <version>${randomizedtesting.version}</version>
                    <configuration>
                        <skipTests>${skip.unit.tests}</skipTests>
                        <listeners>
                            <report-text showNumFailures="30" showOutput="onerror" showStackTraces="true" showStatusError="true" showStatusFailure="true" showStatusIgnored="true" showStatusOk="false" showSuiteSummary="true" showThrowable="true" timestamps="false" />
                            <report-ant-xml dir="${project.build.directory}/surefire-reports" mavenExtensions="true" />
                        </listeners>
                        <heartbeat>20</heartbeat>
                        <jvmOutputAction>warn</jvmOutputAction>
                        <leaveTemporary>true</leaveTemporary>
                        <sysouts>false</sysouts>
                        <assertions>
                            <enable />
                        </assertions>
                        <jvmArgs>
                            <param>-Xmx512m</param>
                            <param>-XX:MaxDirectMemorySize=512m</param>
                            <param>-Des.logger.prefix=</param>
                            <param>-Dtests.gradle=yes</param>
                        </jvmArgs>
                    </configuration>
                    <executions>
                        <!-- Separate unit tests from integration tests
                 The elastic security manager may cause issues
                 with normal unit tests -->
                        <execution>
                            <id>tests-junit</id>
                            <goals>
                                <goal>junit4</goal>
                            </goals>
                            <phase>test</phase>
                            <configuration>
                                <excludes>
                                    <exclude>**/*IntegrationTest.class</exclude>
                                    <exclude>**/*ESTest.class</exclude>
                                </excludes>
                            </configuration>
                        </execution>
                        <execution>
                            <!-- separate integration test because it loads the security manager -->
                            <id>tests-integ</id>
                            <goals>
                                <goal>junit4</goal>
                            </goals>
                            <phase>integration-test</phase>
                            <configuration>
                                <includes>
                                    <include>**/*IntegrationTest.class</include>
                                </includes>
                            </configuration>
                        </execution>
                        <execution>
                            <!-- separate estest because of dirty context between ESIntegTest and ESTestCase -->
                            <id>tests-estest</id>
                            <goals>
                                <goal>junit4</goal>
                            </goals>
                            <phase>test</phase>
                            <configuration>
                                <includes>
                                    <include>**/*ESTest.class</include>
                                </includes>
                                <skipTests>${skip.unit.tests}</skipTests>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>de.is24.mavenplugins</groupId>
                    <artifactId>deadcode4j-maven-plugin</artifactId>
                    <configuration>
                        <superClassesMarkingLiveCode>
                            <liveCode>org.elasticsearch.plugins.Plugin</liveCode>
                        </superClassesMarkingLiveCode>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>de.thetaphi</groupId>
                    <artifactId>forbiddenapis</artifactId>
                    <configuration>
                        <signaturesArtifacts combine.children="append">
                            <signaturesArtifact>
                                <groupId>org.wikimedia.discovery</groupId>
                                <artifactId>discovery-maven-tool-configs</artifactId>
                                <version>${discovery-maven-tool-configs.version}</version>
                                <type>jar</type>
                                <path>org/wikimedia/discovery/build/tools/forbidden/lucene-signatures.txt</path>
                            </signaturesArtifact>
                        </signaturesArtifacts>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <configuration>
                        <appendAssemblyId>false</appendAssemblyId>
                        <outputDirectory>${project.build.directory}/releases/</outputDirectory>
                        <descriptors>
                            <descriptor>${basedir}/../src/main/assemblies/plugin.xml</descriptor>
                        </descriptors>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>single</goal>
                            </goals>
                            <phase>package</phase>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <configuration>
                        <skipTests>true</skipTests>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.pitest</groupId>
                    <artifactId>pitest-maven</artifactId>
                    <configuration>
                        <jvmArgs>
                            <value>-ea</value>
                        </jvmArgs>
                        <mutators>
                            <mutator>ALL</mutator>
                        </mutators>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>com.carrotsearch.randomizedtesting</groupId>
                <artifactId>junit4-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>
