<?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.50</version>
    </parent>

    <groupId>org.wikimedia.search</groupId>
    <artifactId>extra-parent</artifactId>
    <version>7.10.2-wmf1</version>
    <packaging>pom</packaging>
    <name>Elasticsearch extra plugins</name>
    <description>Extra queries and filters for Elasticsearch.</description>

    <url>https://doc.wikimedia.org/search-extra/extra/</url>

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>manybubbles</id>
            <name>Nik Everett</name>
            <email>nik9000+extra@gmail.com</email>
            <timezone>America/New_York</timezone>
        </developer>
        <developer>
            <id>Trey314159</id>
            <name>Trey Jones</name>
            <email>tjones@wikimedia.org</email>
            <timezone>America/New_York</timezone>
        </developer>
        <developer>
            <id>maryum</id>
            <name>Maryum Styles</name>
            <email>mstyles@wikimedia.org</email>
            <timezone>America/Los_Angeles</timezone>
        </developer>
    </developers>

    <modules>
        <module>extra-analysis-homoglyph</module>
        <module>extra-analysis-khmer</module>
        <module>extra-analysis-slovak</module>
        <module>extra-common</module>
        <module>extra</module>
    </modules>

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

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

    <properties>
        <elasticsearch.version>7.10.2</elasticsearch.version>
        <hamcrest.version>2.1</hamcrest.version>
        <log4j.version>2.17.1</log4j.version>
        <lucene.version>8.7.0</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>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <randomizedtesting.version>2.7.1</randomizedtesting.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>21.0</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-core</artifactId>
                <version>${lucene.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.lucene</groupId>
                <artifactId>lucene-memory</artifactId>
                <version>${lucene.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.lucene</groupId>
                <artifactId>lucene-misc</artifactId>
                <version>${lucene.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.lucene</groupId>
                <artifactId>lucene-suggest</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-khmer</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.wikimedia.search</groupId>
                <artifactId>extra-analysis-slovak</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.wikimedia.search</groupId>
                <artifactId>extra-common</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.wikimedia.search</groupId>
                <artifactId>extra-core</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-api</artifactId>
                <version>${log4j.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.hdrhistogram</groupId>
                <artifactId>HdrHistogram</artifactId>
                <version>2.1.9</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>com.carrotsearch.randomizedtesting</groupId>
                <artifactId>randomizedtesting-runner</artifactId>
                <version>${randomizedtesting.version}</version>
                <scope>test</scope>
            </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-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.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>3.11.1</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.elasticsearch</groupId>
                <artifactId>securemock</artifactId>
                <version>1.2</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>
            <!-- Needed by elastic test framework -->
            <dependency>
                <groupId>org.locationtech.jts</groupId>
                <artifactId>jts-core</artifactId>
                <version>1.15.0</version>
                <scope>test</scope>
            </dependency>
            <!-- Needed by elastic test framework -->
            <dependency>
                <groupId>org.locationtech.spatial4j</groupId>
                <artifactId>spatial4j</artifactId>
                <version>0.7</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>
                            <param>-Des.scripting.exception_for_missing_value=true</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>
                        <classesToIgnore>
                            <!--
                                until https://github.com/Scout24/deadcode4j/issues/25
                                is fixed, let's manually ignore all package-info
                            -->
                            <toIgnore>org.wikimedia.search.extra.analysis.filters.package-info</toIgnore>
                            <toIgnore>org.wikimedia.search.extra.analysis.khmer.package-info</toIgnore>
                            <toIgnore>org.wikimedia.search.extra.analysis.slovak.package-info</toIgnore>
                            <toIgnore>org.wikimedia.search.extra.fuzzylike.package-info</toIgnore>
                            <toIgnore>org.wikimedia.search.extra.latency.package-info</toIgnore>
                            <toIgnore>org.wikimedia.search.extra.levenshtein.package-info</toIgnore>
                            <toIgnore>org.wikimedia.search.extra.package-info</toIgnore>
                            <toIgnore>org.wikimedia.search.extra.regex.expression.package-info</toIgnore>
                            <toIgnore>org.wikimedia.search.extra.regex.ngram.package-info</toIgnore>
                            <toIgnore>org.wikimedia.search.extra.regex.package-info</toIgnore>
                            <toIgnore>org.wikimedia.search.extra.router.package-info</toIgnore>
                            <toIgnore>org.wikimedia.search.extra.superdetectnoop.package-info</toIgnore>
                            <toIgnore>org.wikimedia.search.extra.util.package-info</toIgnore>
                        </classesToIgnore>
                    </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.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.apache.maven.plugins</groupId>
                                        <artifactId>maven-enforcer-plugin</artifactId>
                                        <versionRange>[1.0.0,)</versionRange>
                                        <goals>
                                            <goal>enforce</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>de.thetaphi</groupId>
                                        <artifactId>forbiddenapis</artifactId>
                                        <versionRange>[1.5,)</versionRange>
                                        <goals>
                                            <goal>testCheck</goal>
                                            <goal>check</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>com.carrotsearch.randomizedtesting</groupId>
                <artifactId>junit4-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <id>enforce-no-package-cycles</id>
                        <!-- disable enforcer as this project has package cyclic dependencies -->
                        <phase>none</phase>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
