<?xml version="1.0" encoding="UTF-8"?>
<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ~ Copyright 2015 Adobe Systems Incorporated
  ~
  ~ 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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.adobe.cq</groupId>
    <artifactId>core.wcm.components.parent</artifactId>
    <packaging>pom</packaging>
    <version>2.0.0</version>

    <name>Adobe Experience Manager Core WCM Components Parent</name>
    <description>A set of standardized components for AEM 6.3+ that can be used to speed up development of websites.</description>
    <url>https://github.com/adobe/aem-core-wcm-components</url>
    <scm>
        <connection>scm:git:https://github.com/Adobe-Marketing-Cloud/aem-core-wcm-components.git</connection>
        <developerConnection>scm:git:git@github.com:Adobe-Marketing-Cloud/aem-core-wcm-components.git</developerConnection>
        <url>https://github.com/Adobe-Marketing-Cloud/aem-core-wcm-components/tree/master/parent</url>
        <tag>core.wcm.components.reactor-2.0.0</tag>
    </scm>
    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <developers>
        <developer>
            <name>Adobe Reference Squad</name>
            <email>ref-squad@adobe.com</email>
        </developer>
    </developers>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <aem.host>localhost</aem.host>
        <aem.port>4502</aem.port>
        <aem.publish.host>localhost</aem.publish.host>
        <aem.publish.port>4503</aem.publish.port>
        <aem.contextPath />
        <sling.user>admin</sling.user>
        <sling.password>admin</sling.password>
        <vault.user>admin</vault.user>
        <vault.password>admin</vault.password>
        <slf4j.version>1.7.6</slf4j.version>
        <aem.java.version>8</aem.java.version>
        <jacoco.version>0.7.9</jacoco.version>
    </properties>

    <!-- ======================================================================= -->
    <!-- R E P O R T I N G                                                       -->
    <!-- ======================================================================= -->
    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.9</version>
                <configuration>
                    <stylesheet>maven</stylesheet>
                    <encoding>${project.build.sourceEncoding}</encoding>
                    <links>
                        <link>http://docs.oracle.com/javase/${aem.java.version}/docs/api/</link>
                        <link>http://java.sun.com/products/servlet/2.5/docs/servlet-2_5-mr2</link>
                        <link>http://www.day.com/maven/jsr170/javadocs/jcr-2.0/</link>
                        <link>http://sling.apache.org/apidocs/sling5</link>
                        <link>http://dev.day.com/docs/en/cq/current/javadoc</link>
                        <link>http://jackrabbit.apache.org/api/2.4</link>
                        <link>http://www.osgi.org/javadoc/r4v42</link>
                    </links>
                    <excludePackageNames>*.impl:*.internal</excludePackageNames>
                </configuration>
            </plugin>
        </plugins>
    </reporting>


    <!-- ======================================================================= -->
    <!-- B U I L D                                                               -->
    <!-- ======================================================================= -->
    <build>
        <!-- allows shorthand "mvn" to run a normal "mvn clean install" build -->
        <defaultGoal>clean install</defaultGoal>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <configuration>
                        <encoding>${project.build.sourceEncoding}</encoding>
                    </configuration>
                    <version>2.7</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.2</version>
                    <configuration>
                        <source>1.${aem.java.version}</source>
                        <target>1.${aem.java.version}</target>
                        <encoding>${project.build.sourceEncoding}</encoding>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.5.1</version>
                    <dependencies>
                        <dependency>
                            <groupId>org.apache.maven.release</groupId>
                            <artifactId>maven-release-oddeven-policy</artifactId>
                            <version>2.5.1</version>
                        </dependency>
                        <dependency>
                            <groupId>org.apache.maven.scm</groupId>
                            <artifactId>maven-scm-provider-gitexe</artifactId>
                            <version>1.9.1</version>
                        </dependency>
                    </dependencies>
                    <configuration>
                        <scmCommentPrefix>@releng [maven-scm] :</scmCommentPrefix>
                        <preparationGoals>clean install</preparationGoals>
                        <goals>deploy</goals>
                        <releaseProfiles>release</releaseProfiles>
                        <projectVersionPolicyId>OddEvenVersionPolicy</projectVersionPolicyId>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.18.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>2.18.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.sling</groupId>
                    <artifactId>maven-sling-plugin</artifactId>
                    <version>2.1.0</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>install</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <slingUrl>http://${aem.host}:${aem.port}${aem.contextPath}/system/console/bundles</slingUrl>
                        <failOnError>true</failOnError>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.jackrabbit</groupId>
                    <artifactId>filevault-package-maven-plugin</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <failOnMissingEmbed>true</failOnMissingEmbed>
                        <filterSource>${project.basedir}/src/content/META-INF/vault/filter.xml</filterSource>
                        <!-- temporary, until https://issues.apache.org/jira/browse/JCRVLT-219 is fixed -->
                        <failOnDependencyErrors>false</failOnDependencyErrors>
                        <excludes>
                            <!-- exclude .vlt control files in the package -->
                            <exclude>**/.vlt</exclude>
                            <exclude>**/.vltignore</exclude>
                            <exclude>**/.gitignore</exclude>
                            <exclude>**/*.iml</exclude>
                            <exclude>**/.classpath</exclude>
                            <exclude>**/.project</exclude>
                            <exclude>**/.settings</exclude>
                            <exclude>**/.DS_Store</exclude>
                            <exclude>**/target/**</exclude>
                            <exclude>**/pom.xml</exclude>
                        </excludes>
                        <group>adobe/cq60</group>
                        <dependencies>
                            <dependency>
                                <group>day/cq60/product</group>
                                <name>cq-platform-content</name>
                                <version>[1.3.234,)</version>
                            </dependency>
                        </dependencies>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>com.day.jcr.vault</groupId>
                    <artifactId>content-package-maven-plugin</artifactId>
                    <version>1.0.2</version>
                    <configuration>
                        <targetURL>http://${aem.host}:${aem.port}${aem.contextPath}/crx/packmgr/service.jsp</targetURL>
                        <failOnError>true</failOnError>
                        <verbose>true</verbose>
                        <userId>${vault.user}</userId>
                        <userId>${vault.password}</userId>
                        <maxUploadAttemps>3</maxUploadAttemps>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <version>3.2.0</version>
                    <inherited>true</inherited>
                    <configuration>
                        <instructions>
                            <Bundle-RequiredExecutionEnvironment>JavaSE-1.${aem.java.version}</Bundle-RequiredExecutionEnvironment>
                        </instructions>
                    </configuration>
                    <executions>
                        <execution>
                            <id>baseline</id>
                            <goals>
                                <goal>baseline</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>1.4</version>
                    <executions>
                        <execution>
                            <id>enforce-maven</id>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                            <configuration>
                                <rules>
                                    <requireMavenVersion>
                                        <version>[3.3.1,)</version>
                                    </requireMavenVersion>
                                    <requireJavaVersion>
                                        <message>Project must be compiled with Java ${aem.java.version} or higher</message>
                                        <version>1.${aem.java.version}</version>
                                    </requireJavaVersion>
                                </rules>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>1.9.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>2.9</version>
                    <configuration>
                        <excludePackageNames>*.impl:*.internal</excludePackageNames>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.rat</groupId>
                    <artifactId>apache-rat-plugin</artifactId>
                    <version>0.12</version>
                    <configuration>
                        <excludes combine.children="append">
                            <!--  Used by maven-remote-resources-plugin -->
                            <exclude>**/src/main/appended-resources/META-INF/*</exclude>
                            <!--  Generated by maven-remote-resources-plugin -->
                            <exclude>velocity.log</exclude>
                            <!-- don't check anything in target -->
                            <exclude>**/target/*</exclude>
                            <!-- README files in markdown format -->
                            <exclude>**/README.md</exclude>
                            <exclude>CODE_OF_CONDUCT.md</exclude>
                            <exclude>CONTRIBUTING.md</exclude>
                            <!-- Ignore files generated by IDE plugins e.g. maven-eclipse-plugin -->
                            <exclude>maven-eclipse.xml</exclude>
                            <!-- Ignore VLT .content.xml files + dialog configurations -->
                            <exclude>**/jcr_root/**/*.xml</exclude>
                            <!-- Ignore auto-generated VLT file -->
                            <exclude>**/META-INF/vault/settings.xml</exclude>
                            <!-- Ignore .vltignore files -->
                            <exclude>**/.vltignore</exclude>
                            <!-- Ignore .vlt files -->
                            <exclude>**/.vlt</exclude>
                            <!-- Ignore .svg files -->
                            <exclude>**/*.svg</exclude>
                            <!-- Exclude all JSON files -->
                            <exclude>**/*.json</exclude>
                            <!-- Generated for release source archives -->
                            <exclude>DEPENDENCIES</exclude>
                            <!-- .rej files from svn/patch -->
                            <exclude>**/*.rej</exclude>
                            <!-- Jenkins build pipeline configuration file -->
                            <exclude>Jenkinsfile</exclude>
                            <exclude>jenkinsfiles/**/*</exclude>
                            <!-- Ignore IDEA files -->
                            <exclude>**/*.iml</exclude>
                        </excludes>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>verify</phase>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.sling</groupId>
                    <artifactId>htl-maven-plugin</artifactId>
                    <version>1.1.2</version>
                    <configuration>
                        <failOnWarnings>true</failOnWarnings>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${jacoco.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>findbugs-maven-plugin</artifactId>
                    <version>3.0.4</version>
                    <configuration>
                        <effort>Max</effort>
                        <xmlOutput>true</xmlOutput>
                        <excludeFilterFile>src/test/resources/findbugs-exclude.xml</excludeFilterFile>
                    </configuration>
                    <executions>
                        <execution>
                            <id>find-bugs</id>
                            <phase>process-classes</phase>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.4</version>
                <inherited>true</inherited>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.rat</groupId>
                <artifactId>apache-rat-plugin</artifactId>
            </plugin>
        </plugins>

    </build>

    <profiles>
        <!-- ====================================================== -->
        <!-- A D O B E   P U B L I C   P R O F I L E                -->
        <!-- ====================================================== -->
        <profile>
            <id>adobe-public</id>

            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>

            <properties>
                <releaseRepository-Id>adobe-public-releases</releaseRepository-Id>
                <releaseRepository-Name>Adobe Public Releases</releaseRepository-Name>
                <releaseRepository-URL>https://repo.adobe.com/nexus/content/repositories/releases</releaseRepository-URL>
            </properties>

            <repositories>
                <repository>
                    <id>adobe-public-releases</id>
                    <name>Adobe Public Repository</name>
                    <url>https://repo.adobe.com/nexus/content/repositories/releases</url>
                    <releases>
                        <enabled>true</enabled>
                        <updatePolicy>never</updatePolicy>
                    </releases>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                </repository>
            </repositories>

            <pluginRepositories>
                <pluginRepository>
                    <id>adobe-public-releases</id>
                    <name>Adobe Public Repository</name>
                    <url>https://repo.adobe.com/nexus/content/repositories/releases</url>
                    <releases>
                        <enabled>true</enabled>
                        <updatePolicy>never</updatePolicy>
                    </releases>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                </pluginRepository>
            </pluginRepositories>
        </profile>

        <profile>
            <!-- This is the release profile. -->
            <id>release</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <configuration>
                            <encoding>${project.build.sourceEncoding}</encoding>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>


    <!-- ====================================================================== -->
    <!-- D E P E N D E N C I E S                                                -->
    <!-- ====================================================================== -->
    <dependencyManagement>
        <dependencies>
            <!-- OSGi annotations for DS and metatype -->
            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>osgi.annotation</artifactId>
                <version>6.0.1</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>osgi.core</artifactId>
                <version>6.0.0</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>osgi.cmpn</artifactId>
                <version>6.0.0</version>
                <scope>provided</scope>
            </dependency>
            <!-- Logging Dependencies -->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
                <scope>provided</scope>
            </dependency>
            <!-- Apache Sling Dependencies -->
            <dependency>
                <groupId>org.apache.sling</groupId>
                <artifactId>org.apache.sling.commons.osgi</artifactId>
                <version>2.4.0</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.sling</groupId>
                <artifactId>org.apache.sling.commons.johnzon</artifactId>
                <version>1.0.0</version>
                <scope>provided</scope>
            </dependency>

            <!-- javax.inject 1 -->
            <dependency>
                <artifactId>geronimo-atinject_1.0_spec</artifactId>
                <version>1.0</version>
                <groupId>org.apache.geronimo.specs</groupId>
                <scope>provided</scope>
            </dependency>

            <!-- Jackson -->
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-annotations</artifactId>
                <version>2.3.2</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>2.3.2</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-core</artifactId>
                <version>2.3.2</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>
            <!-- JCR -->
            <dependency>
                <groupId>javax.jcr</groupId>
                <artifactId>jcr</artifactId>
                <version>2.0</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.jackrabbit</groupId>
                <artifactId>jackrabbit-jcr-commons</artifactId>
                <version>2.12.1</version>
                <scope>provided</scope>
            </dependency>

            <!-- Commons -->
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>3.5</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>2.5</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>commons-collections</groupId>
                <artifactId>commons-collections</artifactId>
                <version>3.2.2</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>com.google.code.findbugs</groupId>
                <artifactId>jsr305</artifactId>
                <version>2.0.0</version>
                <scope>provided</scope>
            </dependency>

            <!--
                AEM APIs; make sure to not move this bundle upper in the list so that newer APIs available in AEM but not in the Uber
                Jar can be used as dependencies.
             -->
            <dependency>
                <groupId>com.adobe.aem</groupId>
                <artifactId>uber-jar</artifactId>
                <version>6.3.1.2</version>
                <classifier>apis</classifier>
                <scope>provided</scope>
            </dependency>

            <!-- Testing -->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.12</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-simple</artifactId>
                <version>${slf4j.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>1.10.19</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.powermock</groupId>
                <artifactId>powermock-api-mockito</artifactId>
                <version>1.6.4</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.powermock</groupId>
                <artifactId>powermock-module-junit4</artifactId>
                <version>1.6.4</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.powermock</groupId>
                <artifactId>powermock-core</artifactId>
                <version>1.6.4</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>io.wcm</groupId>
                <artifactId>io.wcm.testing.aem-mock</artifactId>
                <version>2.2.6</version>
                <scope>test</scope>
                <exclusions>
                    <exclusion>
                        <groupId>org.apache.commons</groupId>
                        <artifactId>commons-imaging</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.apache.sling</groupId>
                <artifactId>org.apache.sling.testing.sling-mock</artifactId>
                <version>2.2.14</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.sling</groupId>
                <artifactId>org.apache.sling.servlet-helpers</artifactId>
                <version>1.1.2</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.sling</groupId>
                <artifactId>org.apache.sling.i18n</artifactId>
                <version>2.4.4</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <!--
      Deploy to the Maven Repositories using WebDAV URLs. This enables abstracting
      the real location of the repositories and better access control. Finally
      it mirrors read and write operations through the same mechanism.
      NOTE: To use these dav: URLs, the WebDAV extension to Maven Wagon must
      be declared in the build section above.
    -->
    <distributionManagement>
        <repository>
            <id>${releaseRepository-Id}</id>
            <name>${releaseRepository-Name}</name>
            <url>${releaseRepository-URL}</url>
        </repository>
        <snapshotRepository>
            <id>${snapshotRepository-Id}</id>
            <name>${snapshotRepository-Name}</name>
            <url>${snapshotRepository-URL}</url>
            <uniqueVersion>false</uniqueVersion>
        </snapshotRepository>
    </distributionManagement>

</project>
