<?xml version="1.0" encoding="UTF-8"?>
<!--
     Copyright 2021 Basis Technology Corp.
 
     Licensed 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>
    <groupId>com.rosette.elasticsearch</groupId>
    <artifactId>rosette-elasticsearch-parent</artifactId>
    <version>7.16.2.0</version>
    <packaging>pom</packaging>
    <parent>
        <artifactId>open-source-parent</artifactId>
        <groupId>com.basistech</groupId>
        <version>9.0.1</version>
        <relativePath />
    </parent>
    <inceptionYear>2017</inceptionYear>
    <url>http://rosette-api.github.io/rosette-elasticsearch-plugin</url>
    <scm>
        <connection>scm:git:git@github.com:rosette-api/rosette-elasticsearch-plugin.git</connection>
        <developerConnection>scm:git:git@github.com:rosette-api/rosette-elasticsearch-plugin.git</developerConnection>
        <tag>7.16.2.0</tag>
    </scm>
    <description>Elasticsearch plugin parent</description>
    <distributionManagement>
        <site>
            <id>site</id>
            <url>scm:git:git@github.com:rosette-api/rosette-elasticsearch-plugin.git</url>
        </site>
    </distributionManagement>
    <properties>
        <jdk.version>1.8</jdk.version>
        <bt.compile.source>${jdk.version}</bt.compile.source>
        <bt.compile.target>${jdk.version}</bt.compile.target>
        <build-helper-maven-plugin.version>3.2.0</build-helper-maven-plugin.version>
        <elasticsearch.version>7.16.2</elasticsearch.version>
        <log4j.version>2.17.0</log4j.version>
        <maven-enforcer-plugin.version>3.0.0-M3</maven-enforcer-plugin.version>
        <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
        <maven-javadoc-plugin.version>3.3.0</maven-javadoc-plugin.version>
        <!-- Use new server.  https://issues.sonatype.org/browse/OSSRH-76262 -->
        <nexus-staging-plugin-nexus-url>https://s01.oss.sonatype.org</nexus-staging-plugin-nexus-url>
        <rosette.api.binding.version>1.20.0</rosette.api.binding.version>
    </properties>
    <modules>
        <module>plugin</module>
        <module>docker</module>
    </modules>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.basistech.rosette</groupId>
                <artifactId>rosette-api</artifactId>
                <version>${rosette.api.binding.version}</version>
            </dependency>
            <dependency>
                <groupId>org.elasticsearch</groupId>
                <artifactId>elasticsearch</artifactId>
                <version>${elasticsearch.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-api</artifactId>
                <version>${log4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-core</artifactId>
                <version>${log4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.elasticsearch.test</groupId>
                <artifactId>framework</artifactId>
                <version>${elasticsearch.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.apache.commons</groupId>
                        <artifactId>commons-lang3</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <build>
        <defaultGoal>install</defaultGoal>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>${maven-enforcer-plugin.version}</version>
                <executions>
                    <execution>
                        <id>enforce-maven</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>3.6.3</version>
                                </requireMavenVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <encoding>utf-8</encoding>
                    <source>${jdk.version}</source>
                    <target>${jdk.version}</target>
                    <debug>true</debug>
                    <optimize>true</optimize>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven-javadoc-plugin.version}</version>
                <configuration>
                    <source>${jdk.version}</source>
                    <quiet>true</quiet>
                </configuration>
                <executions>
                    <execution>
                        <id>aggregate</id>
                        <goals>
                            <goal>aggregate</goal>
                        </goals>
                        <phase>site</phase>
                    </execution>
                    <execution>
                        <id>plain</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                        <phase>package</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <configuration>
                    <tagNameFormat>@{project.version}</tagNameFormat>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <!-- Override open source parent signing config to use gpg 2.1 args for ci -->
    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven-gpg-plugin.version}</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration combine.self="override">
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven-javadoc-plugin.version}</version>
                <configuration>
                    <source>${jdk.version}</source>
                    <quiet>true</quiet>
                </configuration>
                <reportSets>
                    <reportSet>
                        <id>non-aggregate</id>
                        <reports>
                            <report>javadoc</report>
                        </reports>
                    </reportSet>
                    <reportSet>
                        <id>aggregate</id>
                        <reports>
                            <report>aggregate</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
        </plugins>
    </reporting>
</project>
