<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2017 Alfresco and/or its affiliates.
  ~
  ~ 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/xsd/maven-4.0.0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <groupId>org.activiti.cloud</groupId>
  <version>7-201712-EA</version>
  <artifactId>activiti-cloud-gateway</artifactId>

  <name>Activiti Cloud :: Gateway</name>

  <properties>
    <version.activiti.cloud>${project.version}</version.activiti.cloud>
    <spring.boot.version>2.0.0.M7</spring.boot.version>
    <spring.cloud.version>Finchley.M5</spring.cloud.version>
    <junit.version>4.12</junit.version>
    <mockito.version>2.7.22</mockito.version>

    <docker.maven.plugin.version>0.21.0</docker.maven.plugin.version>
    <jgitflow.plugin.version>1.0-m5.1</jgitflow.plugin.version>
    <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.activiti.cloud</groupId>
        <artifactId>activiti-cloud-dependencies</artifactId>
        <version>${version.activiti.cloud}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-dependencies</artifactId>
        <version>${spring.cloud.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>org.springframework.cloud</groupId>
      <artifactId>spring-cloud-starter-netflix-zuul</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework.cloud</groupId>
      <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
    </dependency>
    <dependency>
      <groupId>org.activiti.cloud</groupId>
      <artifactId>activiti-cloud-services-identity-keycloak</artifactId>
    </dependency>
    <dependency>
      <groupId>org.activiti.cloud</groupId>
      <artifactId>activiti-cloud-services-monitoring</artifactId>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-test</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-test</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>


  <build>
    <plugins>
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <version>${spring.boot.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>repackage</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>io.fabric8</groupId>
        <artifactId>docker-maven-plugin</artifactId>
        <configuration>
          <images>
            <image>
              <name>activiti/activiti-cloud-gateway</name>
              <alias>activit-cloud-gateway</alias>
              <build>
                <from>openjdk:alpine</from>
                <assembly>
                  <descriptorRef>artifact</descriptorRef>
                </assembly>
                <cmd>java ${JAVA_OPTS} -jar maven/${project.artifactId}-${project.version}.jar</cmd>
              </build>
            </image>
          </images>
        </configuration>
        <executions>
          <execution>
            <id>docker:build</id>
            <phase>install</phase>
            <goals>
              <goal>build</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>external.atlassian.jgitflow</groupId>
        <artifactId>jgitflow-maven-plugin</artifactId>
        <version>${jgitflow.plugin.version}</version>
        <configuration>
          <enableFeatureVersions>true</enableFeatureVersions>
          <autoVersionSubmodules>true</autoVersionSubmodules>
          <allowSnapshots>true</allowSnapshots>
          <noDeploy>true</noDeploy>
          <useReleaseProfile>true</useReleaseProfile> <!-- Do not generate javadoc when releaseing -->
          <pushReleases>true</pushReleases>
          <squash>false</squash>
          <versionTagPrefix>activiti-</versionTagPrefix>
          <keepBranch>true</keepBranch>
          <noFeatureBuild>true</noFeatureBuild>
          <noFeatureMerge>true</noFeatureMerge>
          <noReleaseBuild>true</noReleaseBuild>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <repositories>
    <repository>
      <id>spring-milestones</id>
      <name>Spring Milestones</name>
      <url>https://repo.spring.io/libs-milestone</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
    <repository>
      <id>spring-snapshots</id>
      <name>Spring Snapshots</name>
      <url>https://repo.spring.io/libs-snapshot</url>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
    <repository> <!-- Using snapshot repo to temporarily keep keycloak adapter -->
      <id>activiti-snapshots</id>
      <name>Activiti Snapshots</name>
      <url>https://artifacts.alfresco.com/nexus/content/repositories/activiti-snapshots/</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>

  <pluginRepositories>
    <pluginRepository>
      <id>spring-snapshots</id>
      <name>Spring Snapshots</name>
      <url>http://repo.spring.io/snapshot</url>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </pluginRepository>
    <pluginRepository>
      <id>spring-milestones</id>
      <name>Spring Milestones</name>
      <url>http://repo.spring.io/milestone</url>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </pluginRepository>
  </pluginRepositories>


  <profiles>
    <!-- Profile to sign artifacts, triggered when releasing -->
    <profile>
      <id>sign</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>${maven-gpg-plugin.version}</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <distributionManagement>
    <repository>
      <id>activiti-enterprise-snapshots</id>
      <name>Alfresco internal repo</name>
      <url>https://artifacts.alfresco.com/nexus/content/repositories/activiti-releases/</url>
    </repository>
    <snapshotRepository>
      <id>activiti-enterprise-snapshots</id>
      <name>Activiti Snapshots</name>
      <url>https://artifacts.alfresco.com/nexus/content/repositories/activiti-snapshots/</url>
    </snapshotRepository>
  </distributionManagement>

  <!-- Various information, not used by the build -->

  <url>http://activiti.org</url>
  <licenses>
    <license>
      <name>Apache v2</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
    </license>
  </licenses>
  <organization>
    <name>Alfresco</name>
    <url>http://www.alfresco.com</url>
  </organization>
  <inceptionYear>2017</inceptionYear>
  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/Activiti/Activiti/issues</url>
  </issueManagement>
  <ciManagement>
    <system>Travis</system>
    <url>http://bamboo.ci.codehaus.org/browse/ACT</url>
  </ciManagement>
  <scm>
    <url>https://github.com/Activiti/activiti-cloud-gateway</url>
    <connection>scm:git:https://github.com/Activiti/activiti-cloud-gateway.git</connection>
    <developerConnection>scm:git:https://github.com/Activiti/activiti-cloud-gateway.git</developerConnection>
    <tag>HEAD</tag>
  </scm>
  <developers>
    <developer>
      <id>salaboy</id>
      <name>Mauricio Salatino</name>
      <email>mauricio.salatino@alfresco.com</email>
      <organization>Alfresco</organization>
      <organizationUrl>http://alfresco.com</organizationUrl>
    </developer>
    <developer>
      <id>erdemedeiros</id>
      <name>Elias De Medeiros</name>
      <email>elias.demedeiros@alfresco.com</email>
      <organization>Alfresco</organization>
      <organizationUrl>http://alfresco.com</organizationUrl>
    </developer>
    <developer>
      <id>ryandawsonuk</id>
      <name>Ryan Dawson</name>
      <email>ryan.dawson@alfresco.com</email>
      <organization>Alfresco</organization>
      <organizationUrl>http://alfresco.com</organizationUrl>
    </developer>
  </developers>

</project>
