<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>no.mnemonic.services.common</groupId>
  <artifactId>parent</artifactId>
  <packaging>pom</packaging>
  <version>0.3.31</version>

  <name>mnemonic common services</name>
  <description>Reusable Java components for building scalable microservices</description>
  <url>https://github.com/mnemonic-no/common-services</url>
  <inceptionYear>2017</inceptionYear>

  <licenses>
    <license>
      <name>ISC</name>
      <url>https://opensource.org/licenses/ISC</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <organization>
    <name>mnemonic as</name>
    <url>https://www.mnemonic.no</url>
  </organization>

  <developers>
    <developer>
      <name>mnemonic development team</name>
      <email>opensource@mnemonic.no</email>
      <url>https://github.com/mnemonic-no</url>
      <organization>mnemonic as</organization>
      <organizationUrl>https://www.mnemonic.no</organizationUrl>
      <timezone>Europe/Oslo</timezone>
    </developer>
  </developers>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    <!-- JDK compile target -->
    <jdk.version>1.8</jdk.version>

    <!-- mnemonic dependencies -->
    <mnemonic.commons.version>0.4.7</mnemonic.commons.version>
    <mnemonic.messaging.version>1.3.10</mnemonic.messaging.version>

    <!-- external dependencies -->
    <activemq.version>5.16.3</activemq.version>
    <cglib.version>3.3.0</cglib.version>
    <hazelcast.version>3.12.11</hazelcast.version>
    <javax.inject.version>1</javax.inject.version>
    <jaxb.version>2.3.3</jaxb.version>
    <junit.version>4.13.2</junit.version>
    <junit.jupiter.version>5.8.1</junit.jupiter.version>
    <mockito.version>3.10.0</mockito.version>
    <swagger.version>1.6.3</swagger.version>

    <!-- build dependencies -->
    <maven.clean.version>3.1.0</maven.clean.version>
    <maven.compiler.version>3.8.1</maven.compiler.version>
    <maven.deploy.version>2.8.2</maven.deploy.version>
    <maven.enforcer.version>1.4.1</maven.enforcer.version>
    <maven.gpg.version>1.6</maven.gpg.version>
    <maven.install.version>2.5.2</maven.install.version>
    <maven.jar.version>3.1.1</maven.jar.version>
    <maven.javadoc.version>3.1.0</maven.javadoc.version>
    <maven.license.version>1.20</maven.license.version>
    <maven.nexus.staging.version>1.6.8</maven.nexus.staging.version>
    <maven.release.version>2.5.3</maven.release.version>
    <maven.resources.version>3.1.0</maven.resources.version>
    <maven.source.version>3.0.1</maven.source.version>
    <maven.surefire.version>2.22.2</maven.surefire.version>
  </properties>

  <modules>
    <module>auth</module>
    <module>documentation</module>
    <module>hazelcast-consumer</module>
    <module>service-api</module>
    <module>messagebus</module>
  </modules>

  <scm>
    <connection>scm:git:git://github.com/mnemonic-no/common-services.git</connection>
    <developerConnection>scm:git:ssh://github.com:mnemonic-no/common-services.git</developerConnection>
    <url>https://github.com/mnemonic-no/common-services</url>
    <tag>parent-0.3.31</tag>
  </scm>

  <build>
    <resources>
      <!-- Always include license file in generated bundles. -->
      <resource>
        <directory>../</directory>
        <includes>
          <include>LICENSE</include>
        </includes>
      </resource>
      <!-- Include resources from standard resources folder in generated bundles. -->
      <resource>
        <directory>src/main/resources</directory>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>${maven.enforcer.version}</version>
        <executions>
          <execution>
            <id>enforce-maven</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>3.0.5</version>
                </requireMavenVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${maven.compiler.version}</version>
        <configuration>
          <source>${jdk.version}</source>
          <target>${jdk.version}</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven.surefire.version}</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>${maven.jar.version}</version>
        <configuration>
          <archive>
            <manifest>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
            </manifest>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>${maven.release.version}</version>
        <configuration>
          <autoVersionSubmodules>true</autoVersionSubmodules>
          <resume>false</resume>
          <pushChanges>false</pushChanges>
          <localCheckout>true</localCheckout>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-clean-plugin</artifactId>
        <version>${maven.clean.version}</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-install-plugin</artifactId>
        <version>${maven.install.version}</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>${maven.deploy.version}</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>${maven.resources.version}</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>${maven.javadoc.version}</version>
        <configuration>
          <source>${jdk.version}</source>
        </configuration>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>${maven.source.version}</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>${maven.license.version}</version>
        <!-- Execute license check during the build process to detect violations as early as possible. -->
        <executions>
          <execution>
            <id>check-licenses</id>
            <phase>compile</phase>
            <goals>
              <goal>add-third-party</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <!-- Trust that the developers of dependencies have done their homework. -->
          <includeTransitiveDependencies>false</includeTransitiveDependencies>
          <!-- Fail the build if a detected license is not in the white list. -->
          <failIfWarning>true</failIfWarning>
          <!-- Only allow licenses which are in this list. -->
          <includedLicenses>Apache 2|CDDL|Eclipse|ISC|MIT</includedLicenses>
          <!-- Consolidate license names. -->
          <licenseMerges>
            <licenseMerge>Apache 2|ASF 2.0|Apache License 2.0|Apache Software License - Version 2.0|Apache License, Version 2.0|The Apache Software License, Version 2.0</licenseMerge>
            <licenseMerge>CDDL|CDDL 1.1|CDDL + GPLv2 with classpath exception</licenseMerge>
            <licenseMerge>Eclipse|Eclipse Public License 1.0|Eclipse Public License - Version 1.0|Eclipse Distribution License - v 1.0|Eclipse Public License v2.0</licenseMerge>
            <licenseMerge>MIT|The MIT License</licenseMerge>
          </licenseMerges>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <!-- Use this profile to push to internal Artifactory during deploy. -->
      <id>publish-internal</id>
      <distributionManagement>
        <repository>
          <id>mnemonic</id>
          <url>https://artifactory.mnemonic.no/artifactory/mnemonic</url>
        </repository>
        <snapshotRepository>
          <id>mnemonic-snapshots</id>
          <url>https://artifactory.mnemonic.no/artifactory/mnemonic-snapshots</url>
        </snapshotRepository>
      </distributionManagement>
    </profile>
    <profile>
      <!-- Use this profile to push to the central repository (including signing of artifacts). -->
      <id>publish-external</id>
      <distributionManagement>
        <repository>
          <id>ossrh</id>
          <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
        <snapshotRepository>
          <id>ossrh</id>
          <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
      </distributionManagement>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>${maven.gpg.version}</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>${maven.nexus.staging.version}</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
