<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright 2017 Adobe. All rights reserved.
    This file is licensed to you 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 REPRESENTATIONS
    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>com.adobe</groupId>
  <artifactId>aio-lib-java</artifactId>
  <version>0.0.14</version>
  <packaging>pom</packaging>

  <modules>

    <module>core</module>
    <module>ims</module>
    <module>events_mgmt</module>
    <module>events_ingress</module>
    <module>events_journal</module>

    <module>aem</module>

  </modules>

  <name>Adobe I/O - Java SDK - Parent Project</name>
  <description>Adobe I/O - Java SDK - Parent Project</description>
  <url>https://github.com/adobe/aio-lib-java</url>

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

  <!-- required metadata for publishing the Maven artifacts -->
  <organization>
    <name>Adobe</name>
    <url>https://www.adobe.com</url>
  </organization>

  <developers>
    <developer>
      <name>Francois Le Droff</name>
      <email>ledroff@adobe.com</email>
      <organization>Adobe</organization>
      <organizationUrl>https://www.adobe.com</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:https://github.com/adobe/aio-lib-java.git</connection>
    <developerConnection>scm:git:https://github.com/adobe/aio-lib-java.git
    </developerConnection>
    <url>https://github.com/adobe/aio-lib-java/tree/master</url>
    <tag>aio-lib-java-0.0.14</tag>
  </scm>

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

  <properties>
    <java.version>11</java.version>
    <maven.compiler.source>${java.version}</maven.compiler.source>
    <maven.compiler.target>${java.version}</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <license.header.path>${maven.multiModuleProjectDirectory}/copyright_header.txt</license.header.path>

    <maven-resources-plugin.version>3.0.2</maven-resources-plugin.version>
    <jacoco.version>0.8.5</jacoco.version>

    <commons-text.version>1.6</commons-text.version>
    <commons-lang3.version>3.6</commons-lang3.version>
    <junit.version>4.11</junit.version>
    <wiremock.version>2.31.0</wiremock.version>
    <okhttp3.mockwebserver.version>4.9.1</okhttp3.mockwebserver.version>
    <mockito.version>3.11.1</mockito.version>
    <slf4j.version>1.7.21</slf4j.version>
    <slf4j-api.version>[1.7.21,1.7.25]</slf4j-api.version>
    <jackson.version>2.12.3</jackson.version>
    <jjwt.version>0.11.2</jjwt.version>

    <feign.version>11.2</feign.version>
    <feign-form.version>3.8.0</feign-form.version>

    <javax-validation.version>1.1.0.Final</javax-validation.version>

    <xdm.event-model.version>0.92.5</xdm.event-model.version>

    <com.adobe.aem.uber-jar.version>6.5.0</com.adobe.aem.uber-jar.version>
    <javax.jcr.version>2.0</javax.jcr.version>
    <org.osgi.framework.version>1.9.0</org.osgi.framework.version>

  </properties>


  <dependencyManagement>
    <dependencies>

      <!-- adobe.io XDM event model -->
      <dependency>
        <groupId>com.adobe.event</groupId>
        <artifactId>xdm-event-model</artifactId>
        <version>${xdm.event-model.version}</version>
        <scope>provided</scope>
      </dependency>
      <!-- Adobe AEM Dependencies -->
      <dependency>
        <groupId>com.adobe.aem</groupId>
        <artifactId>uber-jar</artifactId>
        <version>${com.adobe.aem.uber-jar.version}</version>
        <classifier>apis</classifier>
        <scope>provided</scope>
      </dependency>

      <dependency>
        <groupId>org.apache.sling</groupId>
        <artifactId>org.apache.sling.servlets.annotations</artifactId>
        <version>1.2.6</version>
        <scope>provided</scope>
      </dependency>


      <!-- JCR -->
      <dependency>
        <groupId>javax.jcr</groupId>
        <artifactId>jcr</artifactId>
        <version>${javax.jcr.version}</version>
        <scope>provided</scope>
      </dependency>


      <!-- OSGi Dependencies for AEM 6.5 and above-->
      <dependency>
        <groupId>org.osgi</groupId>
        <artifactId>org.osgi.annotation.versioning</artifactId>
        <version>1.1.0</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>org.osgi</groupId>
        <artifactId>org.osgi.annotation.bundle</artifactId>
        <version>1.0.0</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>org.osgi</groupId>
        <artifactId>org.osgi.service.metatype.annotations</artifactId>
        <version>1.4.0</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>org.osgi</groupId>
        <artifactId>org.osgi.service.component.annotations</artifactId>
        <version>1.4.0</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>org.osgi</groupId>
        <artifactId>org.osgi.service.component</artifactId>
        <version>1.4.0</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>org.osgi</groupId>
        <artifactId>org.osgi.service.cm</artifactId>
        <version>1.6.0</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>org.osgi</groupId>
        <artifactId>org.osgi.service.event</artifactId>
        <version>1.3.1</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>org.osgi</groupId>
        <artifactId>org.osgi.service.log</artifactId>
        <version>1.4.0</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>org.osgi</groupId>
        <artifactId>org.osgi.resource</artifactId>
        <version>1.0.0</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>org.osgi</groupId>
        <artifactId>org.osgi.framework</artifactId>
        <version>${org.osgi.framework.version}</version>
        <scope>provided</scope>
      </dependency>

      <!-- Servlet API -->
      <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.1.0</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>javax.servlet.jsp</groupId>
        <artifactId>jsp-api</artifactId>
        <version>2.1</version>
        <scope>provided</scope>
      </dependency>


      <dependency>
        <groupId>javax.annotation</groupId>
        <artifactId>javax.annotation-api</artifactId>
        <version>1.3.2</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>javax.validation</groupId>
        <artifactId>validation-api</artifactId>
        <version>${javax-validation.version}</version>
        <scope>provided</scope>
      </dependency>

      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-text</artifactId>
        <version>${commons-text.version}</version>
      </dependency>

      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>${commons-lang3.version}</version>
        <scope>provided</scope>
      </dependency>

      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j-api.version}</version>
        <scope>provided</scope>
      </dependency>

      <dependency>
        <groupId>io.jsonwebtoken</groupId>
        <artifactId>jjwt-api</artifactId>
        <version>${jjwt.version}</version>
      </dependency>
      <dependency>
        <groupId>io.jsonwebtoken</groupId>
        <artifactId>jjwt-impl</artifactId>
        <version>${jjwt.version}</version>
      </dependency>
      <dependency>
        <groupId>io.jsonwebtoken</groupId>
        <artifactId>jjwt-jackson</artifactId>
        <version>${jjwt.version}</version>
      </dependency>

      <dependency>
        <groupId>jakarta.xml.bind</groupId>
        <artifactId>jakarta.xml.bind-api</artifactId>
        <version>3.0.1</version>
      </dependency>

      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>${jackson.version}</version>
      </dependency>

      <dependency>
        <groupId>io.github.openfeign</groupId>
        <artifactId>feign-core</artifactId>
        <version>${feign.version}</version>
      </dependency>
      <dependency>
        <groupId>io.github.openfeign</groupId>
        <artifactId>feign-jackson</artifactId>
        <version>${feign.version}</version>
      </dependency>
      <dependency>
        <groupId>io.github.openfeign</groupId>
        <artifactId>feign-slf4j</artifactId>
        <version>${feign.version}</version>
      </dependency>
      <dependency>
        <groupId>io.github.openfeign.form</groupId>
        <artifactId>feign-form</artifactId>
        <version>${feign-form.version}</version>
      </dependency>

      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit-dep</artifactId>
        <version>${junit.version}</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>com.github.tomakehurst</groupId>
        <artifactId>wiremock-jre8</artifactId>
        <version>${wiremock.version}</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>${slf4j.version}</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>com.squareup.okhttp3</groupId>
        <artifactId>mockwebserver</artifactId>
        <version>${okhttp3.mockwebserver.version}</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>${mockito.version}</version>
        <scope>test</scope>
      </dependency>

    </dependencies>
  </dependencyManagement>


  <build>
    <plugins>
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <!-- Note: run "mvn license:format" to add headers automatically -->
      </plugin>
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
      </plugin>
    </plugins>

    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>com.mycila</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>3.0</version>
          <configuration>
            <header>${license.header.path}</header>
            <excludes>
              <!-- Exclude third-party libs. -->
              <exclude>**/lib/**</exclude>
              <!-- Exclude .txt files in root generated by the jenkins on the CI server. -->
              <exclude>*.txt</exclude>
              <exclude>*.yml</exclude>
              <exclude>*.properties</exclude>
              <exclude>mvnw</exclude>
              <exclude>mvnw.bat</exclude>
              <exclude>maven/maven-wrapper.properties</exclude>
              <exclude>Dockerfile</exclude>
              <exclude>Dockerfile.build</exclude>
              <exclude>Makefile</exclude>
              <exclude>.github/*</exclude>
              <exclude>.vscode/*</exclude>
            </excludes>
            <mapping>
              <!-- Add license headers to Play Framework routes files-->
              <routes>SCRIPT_STYLE</routes>
              <!-- Add license headers HOCON Scala-style config files-->
              <conf>SCRIPT_STYLE</conf>
              <!-- Use SLASHSTAR rather than JAVADOC style for Java files as the later results in dangling Javadoc issue. -->
              <java>SLASHSTAR_STYLE</java>
            </mapping>
          </configuration>
          <executions>
            <execution>
              <!-- Note: run "mvn license:format" to add headers automatically -->
              <id>check-license</id>
              <phase>validate</phase>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>2.2.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-javadoc-plugin</artifactId>
          <version>2.9.1</version>
          <configuration>
            <source>9</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-gpg-plugin</artifactId>
          <version>1.6</version>
          <executions>
            <execution>
              <id>sign-artifacts</id>
              <phase>verify</phase>
              <goals>
                <goal>sign</goal>
              </goals>
              <configuration>
                <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>
          <version>1.6.8</version>
          <extensions>true</extensions>
          <configuration>
            <autoReleaseAfterClose>true</autoReleaseAfterClose>
            <nexusUrl>
              https://oss.sonatype.org/
            </nexusUrl>
            <serverId>ossrh</serverId>
          </configuration>
        </plugin>

        <!-- Maven Jar Plugin -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.1.2</version>
        </plugin>

        <!-- Maven Clean Plugin -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-clean-plugin</artifactId>
          <version>3.1.0</version>
        </plugin>

        <!-- Maven Resources Plugin -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>${maven-resources-plugin.version}</version>
          <configuration>
            <!-- ensure that the empty directories are copied -->
            <includeEmptyDirs>true</includeEmptyDirs>
          </configuration>
        </plugin>

        <!-- Maven Compiler Plugin -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.6.1</version>
        </plugin>

        <!-- Maven Installer Plugin -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-install-plugin</artifactId>
          <version>2.5.2</version>
        </plugin>

        <!-- Maven Surefire Plugin -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.22.1</version>
          <configuration>
            <useSystemClassLoader>false</useSystemClassLoader>
          </configuration>
        </plugin>

        <!-- Maven Failsafe Plugin -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>2.22.1</version>
        </plugin>

        <!-- Maven Deploy Plugin -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>2.8.2</version>
        </plugin>

        <!-- Maven Enforcer Plugin -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>1.4.1</version>
        </plugin>

        <!-- Maven Dependency Plugin -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>

        <!-- Build Helper Maven Plugin -->
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>

      </plugins>
    </pluginManagement>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-gpg-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>

  </profiles>

</project>
