<?xml version="1.0" encoding="UTF-8"?>
<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.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.5.3</version>
    <relativePath/>
  </parent>

  <groupId>org.alfresco</groupId>
  <artifactId>alfresco-event-gateway</artifactId>
  <version>2.0.0-rc1</version>
  <packaging>pom</packaging>
  <name>Alfresco :: Event Gateway :: Parent</name>
  <description>Parent for Alfresco Event Gateway</description>
  <url>https://github.com/Alfresco/${project.scm.repository}</url>
  <inceptionYear>${project.year}</inceptionYear>

  <organization>
    <name>Alfresco Software, Ltd</name>
    <url>https://www.alfresco.com</url>
  </organization>

  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>Miguel Ruiz</name>
      <email>miguel.ruiz@alfresco.com</email>
    </developer>
    <developer>
      <name>Miguel Angel Martin</name>
      <email>mmartin@copyright.com</email>
    </developer>
    <developer>
      <name>Jose Luis Osorno</name>
      <email>josorno@copyright.com</email>
    </developer>
    <developer>
      <name>Nazareth Jimenez</name>
      <email>njimenez@copyright.com</email>
    </developer>
  </developers>

  <modules>
    <module>alfresco-event-gateway-api</module>
    <module>alfresco-event-gateway-app</module>
    <module>alfresco-event-gateway-core</module>
    <module>alfresco-event-gateway-model</module>
    <module>alfresco-event-gateway-spring-boot</module>
    <module>alfresco-event-gateway-spring-boot-starter</module>
  </modules>

  <scm>
    <url>http://github.com/${project.scm.organisation}/${project.scm.repository}</url>
    <connection>scm:git:git://github.com/${project.scm.organisation}/${project.scm.repository}.git
    </connection>
    <developerConnection>scm:git:ssh://git@github.com/${project.scm.organisation}/${project.scm.repository}.git</developerConnection>
    <tag>HEAD</tag>
  </scm>

  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/Alfresco/${project.scm.repository}/issues</url>
  </issueManagement>

  <ciManagement>
    <system>travis-ci</system>
    <url>https://travis-ci.com/${project.scm.organisation}/${project.scm.repository}</url>
  </ciManagement>

  <distributionManagement>
    <repository>
      <id>alfresco-public</id>
      <url>https://artifacts.alfresco.com/nexus/content/repositories/releases</url>
    </repository>
    <snapshotRepository>
      <id>alfresco-public-snapshots</id>
      <url>https://artifacts.alfresco.com/nexus/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>

  <properties>
    <project.scm.organisation>Alfresco</project.scm.organisation>
    <project.scm.repository>alfresco-event-gateway</project.scm.repository>
    <project.year>2021</project.year>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <java.release>11</java.release>
    <java.version>1.${java.release}</java.version>
    <maven.compiler.source>${java.version}</maven.compiler.source>
    <maven.compiler.target>${java.version}</maven.compiler.target>
    <maven.compiler.release>${java.release}</maven.compiler.release>
    <argLine>--add-opens java.base/java.lang=ALL-UNNAMED</argLine>
    <license-maven-plugin.version>3.0</license-maven-plugin.version>
    <docker-maven-plugin.version>0.35.0</docker-maven-plugin.version>
    <keycloak.version>13.0.1</keycloak.version>
    <alfresco-event-model.version>0.0.12</alfresco-event-model.version>
    <json-patch.version>1.13</json-patch.version>
    <feign.version>10.12</feign.version>
    <alfresco-java-sdk.version>5.1.0</alfresco-java-sdk.version>
  </properties>

  <repositories>
    <repository>
      <id>central</id>
      <name>Central Repository</name>
      <url>https://repo.maven.apache.org/maven2</url>
      <layout>default</layout>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
    <repository>
      <id>alfresco-public</id>
      <url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
    </repository>
    <repository>
      <id>alfresco-public-snapshots</id>
      <url>https://artifacts.alfresco.com/nexus/content/groups/public-snapshots</url>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
    <repository>
      <id>alfresco-private-repository</id>
      <url>https://artifacts.alfresco.com/nexus/content/groups/private</url>
    </repository>
  </repositories>

  <pluginRepositories>
    <pluginRepository>
      <id>central</id>
      <name>Central Repository</name>
      <url>https://repo.maven.apache.org/maven2</url>
      <layout>default</layout>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <releases>
        <updatePolicy>never</updatePolicy>
      </releases>
    </pluginRepository>
  </pluginRepositories>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>com.mycila</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>${license-maven-plugin.version}</version>
          <configuration>
            <inlineHeader><![CDATA[
Copyright ${project.inceptionYear}-${project.year} ${project.organization.name}.

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.]]>
            </inlineHeader>
            <includes>
              <include>**/*.java</include>
            </includes>
            <mapping>
              <java>SLASHSTAR_STYLE</java>
            </mapping>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
          <doclint>none</doclint>
        </configuration>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <phase>deploy</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-sources</id>
            <phase>deploy</phase>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <!-- force deploy execution after javadoc and sources jars are created -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <executions>
          <execution>
            <id>deploy</id>
            <phase>deploy</phase>
            <goals>
              <goal>deploy</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>validate-license</id>
            <phase>validate</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.alfresco</groupId>
        <artifactId>alfresco-event-gateway-api</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.alfresco</groupId>
        <artifactId>alfresco-event-gateway-core</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.alfresco</groupId>
        <artifactId>alfresco-event-gateway-model</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.alfresco</groupId>
        <artifactId>alfresco-event-gateway-spring-boot</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.alfresco</groupId>
        <artifactId>alfresco-event-gateway-spring-boot-starter</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.keycloak.bom</groupId>
        <artifactId>keycloak-adapter-bom</artifactId>
        <version>${keycloak.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.alfresco</groupId>
        <artifactId>acs-event-model</artifactId>
        <version>${alfresco-event-model.version}</version>
      </dependency>
      <dependency>
        <groupId>com.github.java-json-tools</groupId>
        <artifactId>json-patch</artifactId>
        <version>${json-patch.version}</version>
      </dependency>
      <dependency>
        <groupId>org.alfresco</groupId>
        <artifactId>alfresco-java-rest-api-spring-boot-starter</artifactId>
        <version>${alfresco-java-sdk.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <profiles>
    <profile>
      <id>docker</id>
      <properties>
        <spring-boot.repackage.skip>false</spring-boot.repackage.skip>
        <docker.tag>%v</docker.tag>
        <docker.registry>docker.io</docker.registry>
        <docker.name>alfresco/%a:${docker.tag}</docker.name>
        <docker.buildArg.JAR_FILE>target/${project.build.finalName}.${project.packaging}</docker.buildArg.JAR_FILE>
      </properties>
      <activation>
        <file>
          <exists>Dockerfile</exists>
        </file>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>pl.project13.maven</groupId>
            <artifactId>git-commit-id-plugin</artifactId>
            <configuration>
              <verbose>false</verbose>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>io.fabric8</groupId>
            <artifactId>docker-maven-plugin</artifactId>
            <version>${docker-maven-plugin.version}</version>
            <executions>
              <execution>
                <id>docker-build</id>
                <phase>package</phase>
                <goals>
                  <goal>build</goal>
                </goals>
              </execution>
              <execution>
                <id>docker-push</id>
                <phase>deploy</phase>
                <goals>
                  <goal>push</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
