<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>org.opennms.nephron</groupId>
    <artifactId>nephron-parent</artifactId>
    <packaging>pom</packaging>
    <version>0.3.0</version>
    <name>Nephron :: Parent</name>
    <url>https://github.com/OpenNMS/nephron</url>
    <description>Streaming analytics for OpenNMS</description>

    <licenses>
        <license>
            <name>GNU Affero General Public License</name>
            <url>http://www.gnu.org/licenses/agpl.html</url>
        </license>
    </licenses>

    <scm>
        <url>https://github.com/OpenNMS/nephron</url>
        <connection>scm:git:git@github.com:OpenNMS/nephron.git</connection>
        <tag>HEAD</tag>
    </scm>

    <developers>
        <developer>
            <id>j-white</id>
            <name>Jesse White</name>
            <email>jesse@opennms.com</email>
        </developer>
    </developers>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <beam.version>2.31.0</beam.version>
        <elasticsearch.client.version>7.7.1</elasticsearch.client.version>
        <flink.artifact.name>beam-runners-flink-1.13</flink.artifact.name>
        <java.version>11</java.version>
        <junit.version>4.13</junit.version>
        <kafka.version>2.6.0</kafka.version>
        <log4j.version>2.13.3</log4j.version>
        <opennms.version>26.1.0-SNAPSHOT</opennms.version>
        <protobuf.version>3.11.4</protobuf.version>
        <slf4j.version>1.7.30</slf4j.version>
        <testcontainers.version>1.15.3</testcontainers.version>
        <jqwik.version>1.3.10</jqwik.version>
        <okhttp.version>3.10.0</okhttp.version>
        <okhttp.bundle.version>3.10.0_2</okhttp.bundle.version>
    </properties>

    <modules>
        <module>assemblies</module>
        <module>cortex</module>
        <module>main</module>
        <module>proto</module>
        <module>catheter</module>
        <module>generator</module>
        <module>testing</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.opennms.catheter</groupId>
                <artifactId>catheter</artifactId>
                <version>[1.0,2.0)</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>jcl-over-slf4j</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.beam</groupId>
                <artifactId>beam-sdks-java-core</artifactId>
                <version>${beam.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.beam</groupId>
                <artifactId>beam-sdks-java-io-kafka</artifactId>
                <version>${beam.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.beam</groupId>
                <artifactId>beam-sdks-java-io-elasticsearch</artifactId>
                <version>${beam.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.kafka</groupId>
                <artifactId>kafka-clients</artifactId>
                <version>${kafka.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.protobuf</groupId>
                <artifactId>protobuf-java</artifactId>
                <version>${protobuf.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.protobuf</groupId>
                <artifactId>protobuf-java-util</artifactId>
                <version>${protobuf.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-slf4j-impl</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.client</groupId>
                <artifactId>elasticsearch-rest-client</artifactId>
                <version>${elasticsearch.client.version}</version>
            </dependency>
            <dependency>
                <groupId>com.swrve</groupId>
                <artifactId>rate-limited-logger</artifactId>
                <version>2.0.1</version>
            </dependency>
            <dependency>
                <groupId>it.unimi.dsi</groupId>
                <artifactId>fastutil</artifactId>
                <version>8.5.2</version>
            </dependency>
            <dependency>
                <groupId>com.codepoetics</groupId>
                <artifactId>protonpack</artifactId>
                <version>1.16</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.datatype</groupId>
                <artifactId>jackson-datatype-joda</artifactId>
                <version>2.12.3</version>
            </dependency>
            <dependency>
                <groupId>org.apache.servicemix.bundles</groupId>
                <artifactId>org.apache.servicemix.bundles.okhttp</artifactId>
                <version>${okhttp.bundle.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>com.squareup.okio</groupId>
                        <artifactId>okio</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>com.squareup.okhttp3</groupId>
                <artifactId>logging-interceptor</artifactId>
                <version>${okhttp.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>3.12.0</version>
            </dependency>
            <dependency>
                <groupId>org.jparsec</groupId>
                <artifactId>jparsec</artifactId>
                <version>3.1</version>
            </dependency>

            <!-- Test dependencies -->
            <dependency>
                <groupId>org.apache.beam</groupId>
                <artifactId>beam-runners-direct-java</artifactId>
                <version>${beam.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.awaitility</groupId>
                <artifactId>awaitility</artifactId>
                <version>4.0.2</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-core</artifactId>
                <version>2.2</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.testcontainers</groupId>
                <artifactId>kafka</artifactId>
                <version>${testcontainers.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.testcontainers</groupId>
                <artifactId>elasticsearch</artifactId>
                <version>${testcontainers.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>3.3.3</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.skyscreamer</groupId>
                <artifactId>jsonassert</artifactId>
                <version>1.5.0</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.elasticsearch.client</groupId>
                <artifactId>elasticsearch-rest-high-level-client</artifactId>
                <version>${elasticsearch.client.version}</version>
                <scope>test</scope>
            </dependency>
            <!--
                if the jqwik dependency is added then the junit-vintage-engine must be added too
                -> the auto-detection mechanism of the surefire plugin does no more add the
                   junit-vintage-engine because jqwik already adds the jqwik-engine
            -->
            <dependency>
                <groupId>net.jqwik</groupId>
                <artifactId>jqwik</artifactId>
                <version>${jqwik.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.vintage</groupId>
                <artifactId>junit-vintage-engine</artifactId>
                <version>5.6.2</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mock-server</groupId>
                <artifactId>mockserver-junit-rule</artifactId>
                <version>5.11.1</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>io.rest-assured</groupId>
                <artifactId>rest-assured</artifactId>
                <version>4.4.0</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.5.1</version>
                    <configuration>
                        <source>${java.version}</source>
                        <target>${java.version}</target>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <version>4.2.1</version>
                    <extensions>true</extensions>
                    <configuration>
                        <instructions>
                            <Bundle-RequiredExecutionEnvironment>JavaSE-${java.version}
                            </Bundle-RequiredExecutionEnvironment>
                        </instructions>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.2.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>3.2.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>3.0.0-M4</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.22.2</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>1.3.2</version>
                    <!--
                        execution is skipped by default and can be switched on for a specific submodules by profiles
                        -> allows to execute main classes of submodules from compiled sources without the need for
                           installing submodule artifacts locally first. (The submodule dependencies are resolved
                           by Mavens project classpath.)
                    -->
                    <configuration>
                        <skip>true</skip>
                        <executable>java</executable>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.8</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>opennms-ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
                <configuration>
                    <tagNameFormat>v@{project.version}</tagNameFormat>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <releaseProfiles>release</releaseProfiles>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.2.0</version>
                <executions>
                    <execution>
                        <id>attach-javadoc</id>
                        <goals><goal>jar</goal></goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.2.0</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals><goal>jar</goal></goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <extensions>
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-ssh-external</artifactId>
                <version>3.4.0</version>
            </extension>
        </extensions>
    </build>

    <repositories>
        <repository>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
            </releases>
            <id>opennms-repo</id>
            <name>OpenNMS Repository</name>
            <url>http://maven.opennms.org/content/groups/opennms.org-release/</url>
        </repository>
    </repositories>

    <distributionManagement>
        <snapshotRepository>
            <id>opennms-ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>opennms-ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>disable-java8-doclint</id>
            <activation>
                <jdk>[1.8,)</jdk>
            </activation>
            <properties>
                <additionalparam>-Xdoclint:none</additionalparam>
            </properties>
        </profile>
    </profiles>
</project>
