<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Licensed under the EUPL, Version 1.2 or – as soon they will be approved by
  ~ the European Commission - subsequent versions of the EUPL (the "Licence");
  ~ You may not use this work except in compliance with the Licence.
  ~ You may obtain a copy of the Licence at:
  ~
  ~   https://joinup.ec.europa.eu/software/page/eupl
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the Licence is distributed on an "AS IS" basis,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the Licence for the specific language governing permissions and
  ~ limitations under the Licence.
  ~
  -->

<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.entur.ror</groupId>
        <artifactId>superpom</artifactId>
        <version>1.68</version>
    </parent>

    <groupId>org.entur.ror.helpers</groupId>
    <artifactId>helper</artifactId>
    <version>1.101</version>
    <packaging>pom</packaging>

    <name>entur-helper</name>
    <description>Shared libraries used in other route database/journey planning components</description>
    <url>https://github.com/entur/rutebanken-helpers</url>
    <inceptionYear>2016</inceptionYear>
    <organization>
        <name>Entur AS</name>
        <url>https://www.entur.org/</url>
    </organization>
    <licenses>
        <license>
            <name>EUPL-1.2 with modifications</name>
            <url>https://joinup.ec.europa.eu/software/page/eupl</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <modules>
        <module>gcp-storage</module>
        <module>hazelcast-helper</module>
        <module>hazelcast4-helper</module>
        <module>calendar-helper</module>
        <module>organisation</module>
        <module>logging</module>
        <module>slack</module>
        <module>entur-google-pubsub</module>
        <module>camel-entur-google-pubsub</module>
        <module>camel3-entur-google-pubsub</module>
        <module>oauth2</module>
    </modules>

    <scm>
        <connection>scm:git:ssh://git@github.com/entur/rutebanken-helpers.git</connection>
        <developerConnection>scm:git:ssh://git@github.com/entur/rutebanken-helpers.git</developerConnection>
        <url>https://github.com/entur/rutebanken-helpers/tree/master</url>
        <tag>HEAD</tag>
    </scm>

    <distributionManagement>
        <repository>
            <id>central</id>
            <name>entur2-releases</name>
            <url>https://entur2.jfrog.io/entur2/libs-release-local</url>
        </repository>
        <snapshotRepository>
            <id>snapshots</id>
            <name>entur2-snapshots</name>
            <url>https://entur2.jfrog.io/entur2/libs-snapshot-local</url>
        </snapshotRepository>
    </distributionManagement>

    <properties>
        <license.licenseName>eupl-1.2</license.licenseName>
        <license.licenseResolver>${project.baseUri}/src/license</license.licenseResolver>

        <java.version>11</java.version>

        <spring-cloud-gcp.version>3.5.0</spring-cloud-gcp.version>
        <camel.version>2.25.4</camel.version>
        <camel3.version>3.20.4</camel3.version>
        <!-- Kubernetes client version aligned on camel-kubernetes transitive dependency -->
        <kubernetes-client.version>6.5.1</kubernetes-client.version>
        <commons-io.version>2.11.0</commons-io.version>
        <hazelcast-kubernetes.version>2.2.3</hazelcast-kubernetes.version>

        <hamcrest.version>2.2</hamcrest.version>

        <nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>
        <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>


        <!-- empty argLine property, the value is set up by Jacoco during unit tests execution -->
        <argLine/>

    </properties>

    <dependencyManagement>
        <dependencies>

            <dependency>
                <groupId>org.entur.ror.helpers</groupId>
                <artifactId>organisation</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.entur.ror.helpers</groupId>
                <artifactId>entur-google-pubsub</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.cloud</groupId>
                <artifactId>spring-cloud-gcp-dependencies</artifactId>
                <version>${spring-cloud-gcp.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>com.hazelcast</groupId>
                <artifactId>hazelcast-kubernetes</artifactId>
                <version>${hazelcast-kubernetes.version}</version>
            </dependency>

            <!--See compatibility matrix https://github.com/fabric8io/kubernetes-client#compatibility-matrix -->
            <dependency>
                <groupId>io.fabric8</groupId>
                <artifactId>kubernetes-client</artifactId>
                <version>${kubernetes-client.version}</version>
            </dependency>

            <dependency>
                <groupId>org.apache.camel</groupId>
                <artifactId>camel-bom</artifactId>
                <version>${camel.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>${commons-io.version}</version>
            </dependency>

            <!--test-->
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest</artifactId>
                <version>${hamcrest.version}</version>
                <scope>test</scope>
            </dependency>

        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <argLine>@{argLine} -Xms500m -Xmx500m -Xss256k</argLine>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.amashchenko.maven.plugin</groupId>
                <artifactId>gitflow-maven-plugin</artifactId>
                <version>${gitflow-maven-plugin.version}</version>
                <configuration>
                    <allowSnapshots>false</allowSnapshots>
                    <verbose>true</verbose>
                    <commitMessagePrefix>[ci skip]</commitMessagePrefix>
                    <gitFlowConfig>
                        <productionBranch>1.x</productionBranch>
                        <developmentBranch>1.x</developmentBranch>
                    </gitFlowConfig>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>${nexus-staging-maven-plugin.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <!-- Set this to true and the release will automatically proceed and sync to Central Repository will follow  -->
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <distributionManagement>
                <repository>
                    <id>ossrh</id>
                    <name>Sonatype release</name>
                    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
                </repository>
            </distributionManagement>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <configuration>
                            <doclint>none</doclint>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven-gpg-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <phase>verify</phase>
                                <configuration>
                                    <passphrase>${env.SONATYPE_GPG_KEY_PASSWORD}</passphrase>
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
