<?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.aio</groupId>
  <artifactId>aio-lib-java</artifactId>
  <version>0.0.22</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>
      <id>francoisledroff</id>
      <name>Francois Le Droff</name>
      <email>ledroff@adobe.com</email>
      <organization>Adobe</organization>
      <organizationUrl>https://www.adobe.com</organizationUrl>
    </developer>
    <developer>
      <id>bstopp</id>
      <name>Bryan Stopp</name>
      <email>stopp@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.22</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>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

    <license.header.path>${maven.multiModuleProjectDirectory}/copyright_header.txt</license.header.path>

    <jacoco.version>0.8.3</jacoco.version> <!-- See https://github.com/jacoco/jacoco/issues/896#issuecomment-500944865 -->

    <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.32.0</wiremock.version>
    <okhttp3.mockwebserver.version>4.9.1</okhttp3.mockwebserver.version>
    <mockito.version>4.4.0</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>
    
    <xdm.event-model.version>0.92.5</xdm.event-model.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>

      <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>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>enforce-maven</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>[3.3.9,)</version>
                </requireMavenVersion>
                <requireJavaVersion>
                  <message>Maven must be executed with a Java 8 JRE or higher.</message>
                  <version>1.8.0</version>
                </requireJavaVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
      </plugin>
      <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>
        <extensions>true</extensions>
        <configuration>
          <stagingProgressTimeoutMinutes>30</stagingProgressTimeoutMinutes>
          <altStagingDirectory>${maven.multiModuleProjectDirectory}/dist/nexus-staging</altStagingDirectory>
          <serverId>ossrh</serverId>
          <nexusUrl>https://oss.sonatype.org/</nexusUrl>
        </configuration>
      </plugin>
    </plugins>

    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>com.mycila</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>4.1</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>**/*.log</exclude>
              <exclude>**/*.bnd</exclude>
              <exclude>**/*.config</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>
              <exclude>docs/**</exclude>
              <exclude>dist/**</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>3.2.1</version>
          <inherited>true</inherited>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.2.2</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-clean-plugin</artifactId>
          <version>3.1.0</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>3.0.0-M5</version>
          <configuration>
            <useReleaseProfile>false</useReleaseProfile>
            <releaseProfiles>release</releaseProfiles>
            <autoVersionSubmodules>true</autoVersionSubmodules>
            <projectVersionPolicyId>OddEvenVersionPolicy</projectVersionPolicyId>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>3.2.0</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.10.1</version>
          <configuration>
            <source>11</source>
            <target>11</target>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-install-plugin</artifactId>
          <version>2.5.2</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.22.2</version>
          <configuration>
            <useSystemClassLoader>false</useSystemClassLoader>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>2.22.2</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>2.8.2</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>3.2.0</version>
        </plugin>

        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>3.3.0</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>3.3.2</version>
          <configuration>
            <source>11</source>
            <notimestamp>true</notimestamp>
            <quiet>true</quiet>
            <doctitle>Adobe I/O - Java SDK API v${project.version}</doctitle>
            <windowtitle>Adobe I/O - Java SDK API v${project.version}</windowtitle>
            <excludePackageNames>
              *.impl,
              *.internal,
              *.internal.*,
              *.api,
              *.feign,
              *.feign.*
            </excludePackageNames>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>3.0.1</version>
        </plugin>

        <plugin>
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <version>${jacoco.version}</version>
          <executions>
            <execution>
              <id>prepare-agent</id>
              <goals>
                <goal>prepare-agent</goal>
              </goals>
            </execution>
            <execution>
              <id>report</id>
              <phase>test</phase>
              <goals>
                <goal>report</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <plugin>
          <groupId>org.sonatype.plugins</groupId>
          <artifactId>nexus-staging-maven-plugin</artifactId>
          <version>1.6.12</version>
        </plugin>

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

  <profiles>
    <profile>
      <id>cleanDist</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-clean-plugin</artifactId>
            <configuration>
              <filesets>
                <fileset>
                  <directory>dist</directory>
                </fileset>
              </filesets>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>attach-javadoc</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-javadoc</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>attach-source</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-source</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>release</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <configuration>
              <gpgArguments>
                <arg>--pinentry-mode</arg>
                <arg>loopback</arg>
              </gpgArguments>
            </configuration>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>generate-site-docs</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-clean-plugin</artifactId>
            <configuration>
              <filesets>
                <fileset>
                  <directory>docs/apidocs</directory>
                </fileset>
              </filesets>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-resources-plugin</artifactId>
            <executions>
              <execution>
                <id>process-docs</id>
                <goals>
                  <goal>copy-resources</goal>
                </goals>
                <phase>process-resources</phase>
                <configuration>
                  <outputDirectory>${project.basedir}/docs</outputDirectory>
                  <resources>
                    <resource>
                      <filtering>true</filtering>
                      <directory>${project.basedir}/src/doc/resources</directory>
                      <includes>
                        <include>index.md</include>
                      </includes>
                    </resource>
                  </resources>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <configuration>
              <reportOutputDirectory>${project.basedir}/docs/apidocs</reportOutputDirectory>
            </configuration>
            <executions>
              <execution>
                <id>aggregate</id>
                <goals>
                  <goal>aggregate</goal>
                </goals>
                <phase>process-resources</phase>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
