<?xml version="1.0" encoding="UTF-8"?>
<!-- (C) Copyright 2015 Netcentric AG. All rights reserved. This program
    and the accompanying materials are made available under the terms of the
    Eclipse Public License v1.0 which accompanies this distribution, and is available
    at http://www.eclipse.org/legal/epl-v10.html -->
<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>
    <!-- ====================================================================== -->
    <!-- P A R E N T P R O J E C T D E S C R I P T I O N -->
    <!-- ====================================================================== -->

    <groupId>biz.netcentric.cq.tools.accesscontroltool</groupId>
    <artifactId>accesscontroltool</artifactId>
    <version>2.3.2</version>
    <packaging>pom</packaging>

    <name>Access Control Tool - Reactor Project</name>
    <description>Maven Multimodule project for Access Control Tool.</description>
    <url>https://github.com/Netcentric/accesscontroltool</url>

    <developers>
        <developer>
            <name>Georg Henzler</name>
            <email>georg.henzler@netcentric.biz</email>
            <organization>Netcentric</organization>
            <organizationUrl>http://www.netcentric.biz/</organizationUrl>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>Eclipse Public License, Version 1.0</name>
            <url>https://www.eclipse.org/legal/epl-v10.html</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:ssh://git@github.com/Netcentric/accesscontroltool.git</connection>
        <developerConnection>scm:git:ssh://git@github.com/Netcentric/accesscontroltool.git</developerConnection>
        <url>https://github.com/Netcentric/accesscontroltool.git</url>
        <tag>2.3.2</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>

    <prerequisites>
        <maven>3.0.2</maven>
    </prerequisites>

    <!-- ====================================================================== -->
    <!-- P R O P E R T I E S -->
    <!-- ====================================================================== -->
    <properties>
        <crx.host>localhost</crx.host>
        <crx.port>4502</crx.port>
        <crx.username>admin</crx.username>
        <crx.password>admin</crx.password>
        <publish.crx.host>localhost</publish.crx.host>
        <publish.crx.port>4503</publish.crx.port>
        <publish.crx.username>admin</publish.crx.username>
        <publish.crx.password>admin</publish.crx.password>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <slf4j.version>1.7.6</slf4j.version>
        <bnd.version>4.1.0</bnd.version>
    </properties>

    <modules>
        <module>accesscontroltool-bundle</module>
        <module>accesscontroltool-package</module>
        <module>accesscontroltool-oakindex-package</module>
        <module>accesscontroltool-exampleconfig-package</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <!-- Runtime dependencies should be AEM 6.1 compatible -->
            <dependency>
                <groupId>org.apache.jackrabbit</groupId>
                <artifactId>jackrabbit-jcr-commons</artifactId>
                <version>2.10.0</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.jackrabbit.vault</groupId>
                <artifactId>org.apache.jackrabbit.vault</artifactId>
                <version>3.1.18</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.sling</groupId>
                <artifactId>org.apache.sling.settings</artifactId>
                <version>1.3.6</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>com.day.jcr.vault</groupId>
                <artifactId>com.day.jcr.vault</artifactId>
                <version>2.5.10</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>com.day.cq</groupId>
                <artifactId>cq-commons</artifactId>
                <!-- newer version 5.8.32 shipped with AEM 6.1 SP1 is available in the Adobe Repo but the referenced parent pom.xml is not -->
                <version>5.8.2</version>
                <scope>provided</scope>
            </dependency>
            <!-- OSGi annotations (build time only) -->
            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>org.osgi.service.component.annotations</artifactId>
                <version>1.3.0</version>
            </dependency>
            <!-- for Version annotations and Provider annotations, official OSGi version (supported by bnd as well) -->
            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>org.osgi.annotation.versioning</artifactId>
                <version>1.0.0</version>
            </dependency>
            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>org.osgi.service.metatype.annotations</artifactId>
                <version>1.3.0</version>
            </dependency>
            <!-- Apache Felix 4.6.1 (shipped in AEM 6.1) is fully compliant with OSGi Core R6 -->
            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>org.osgi.framework</artifactId>
                <version>1.8.0</version>
                <scope>provided</scope>
            </dependency>
            <!-- and mostly compliant with OSGi Compendium R6 -->
            <!--  Config Admin 1.5 (https://osgi.org/javadoc/r6/cmpn/org/osgi/service/component/package-summary.html) -->
            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>org.osgi.service.cm</artifactId>
                <version>1.5.0</version>
            </dependency>
            <!--  Event Admin 1.3.1 (https://osgi.org/javadoc/r6/cmpn/org/osgi/service/event/package-summary.html) -->
            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>org.osgi.service.event</artifactId>
                <version>1.3.1</version>
            </dependency>
            <!-- only constants are referenced from there which are inlined during compilation anyways, therefore no runtime dependency -->
            <dependency>
                <groupId>org.apache.sling</groupId>
                <artifactId>org.apache.sling.event.dea</artifactId>
                <!-- shipped with AEM 6.1 -->
                <version>1.0.0</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.sling</groupId>
                <artifactId>org.apache.sling.commons.scheduler</artifactId>
                <!-- shipped with AEM 6.1 -->
                <version>2.4.6</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>javax.servlet-api</artifactId>
                <version>3.1.0</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>javax.jcr</groupId>
                <artifactId>jcr</artifactId>
                <version>2.0</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.sling</groupId>
                <artifactId>org.apache.sling.api</artifactId>
                <version>2.9.0</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.sling</groupId>
                <artifactId>org.apache.sling.jcr.api</artifactId>
                <version>2.2.0</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.sling</groupId>
                <artifactId>org.apache.sling.commons.osgi</artifactId>
                <version>2.2.2</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>commons-lang</groupId>
                <artifactId>commons-lang</artifactId>
                <version>2.5</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>2.4</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>commons-collections</groupId>
                <artifactId>commons-collections</artifactId>
                <version>3.2.1</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.jackrabbit</groupId>
                <artifactId>jackrabbit-api</artifactId>
                <version>2.10.0</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.yaml</groupId>
                <artifactId>snakeyaml</artifactId>
                <version>1.13</version>
                <type>bundle</type>
            </dependency>
            <dependency>
                <groupId>org.apache.sling</groupId>
                <artifactId>org.apache.sling.hc.core</artifactId>
                <version>1.1.0</version>
                <scope>provided</scope>
                <optional>true</optional>
            </dependency>            
            
            <!-- START: Optional AEM dependencies -->
            <dependency>
                <groupId>com.adobe.granite</groupId>
                <artifactId>com.adobe.granite.jmx</artifactId>
                <!-- latest version available in repo.adobe.com, but AEM 6.1 SP1 actually ships with the newer version 0.3.0 -->
                <version>0.2.6</version>
                <scope>provided</scope>
                <optional>true</optional>
            </dependency>
            <dependency>
                <groupId>com.day.cq</groupId>
                <artifactId>cq-security</artifactId>
                <!-- latest version available in repo.adobe.com, but AEM 6.1 SP1 actually ships with a newer version 5.8.18 -->
                <version>5.6.2</version>
                <scope>provided</scope>
                <optional>true</optional>
            </dependency>
            <!-- the com.adobe.granite:com.adobe.granite.crypto:3.0.0 is referencing an non-published parent pom.xml therefore for that we need
                to leverage the uber-jar -->
            <dependency>
                <groupId>com.adobe.aem</groupId>
                <artifactId>uber-jar</artifactId>
                <version>6.1.0-SP1-B0001</version>
                <classifier>obfuscated-apis</classifier>
                <scope>provided</scope>
                <optional>true</optional>
            </dependency>            
            <!-- END: Optional AEM dependencies -->
            

            <!-- testing dependencies -->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.11</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-core</artifactId>
                <version>1.3</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-library</artifactId>
                <version>1.3</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-log4j12</artifactId>
                <version>${slf4j.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <!-- Inclusion of repositories in POMs is controversial, to say the least.
        It would be best if you proxied the Adobe repository using a Maven Repository
        Manager. Once you do that, remove these sections. -->
    <repositories>
        <repository>
            <id>adobe</id>
            <name>Adobe Public Repository</name>
            <url>http://repo.adobe.com/nexus/content/groups/public/</url>
            <layout>default</layout>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>adobe</id>
            <name>Adobe Public Repository</name>
            <url>http://repo.adobe.com/nexus/content/groups/public/</url>
            <layout>default</layout>
        </pluginRepository>
    </pluginRepositories>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>biz.aQute.bnd</groupId>
                    <artifactId>bnd-maven-plugin</artifactId>
                    <version>${bnd.version}</version>
                </plugin>
                <plugin>
                    <groupId>biz.aQute.bnd</groupId>
                    <artifactId>bnd-baseline-maven-plugin</artifactId>
                    <version>${bnd.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.8.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>3.0.0-M1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>3.0.0-M1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.22.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.0.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.0.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.sling</groupId>
                    <artifactId>maven-sling-plugin</artifactId>
                    <version>2.3.8</version>
                    <configuration>
                        <username>${crx.username}</username>
                        <password>${crx.password}</password>
                    </configuration>
                </plugin>
                <!-- for building content packages -->
                <plugin>
                    <groupId>org.apache.jackrabbit</groupId>
                    <artifactId>filevault-package-maven-plugin</artifactId>
                    <version>1.0.3</version>
                    <extensions>true</extensions>
                </plugin>
                <!-- for deploying to AEM -->
                <plugin>
                    <groupId>com.day.jcr.vault</groupId>
                    <artifactId>content-package-maven-plugin</artifactId>
                    <version>1.0.2</version>
                    <configuration>
                        <failOnError>true</failOnError>
                        <username>${crx.username}</username>
                        <password>${crx.password}</password>
                    </configuration>
                </plugin>
                <!--This plugin's configuration is used to store Eclipse m2e settings
                    only. It has no influence on the Maven build itself. -->
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            org.apache.felix
                                        </groupId>
                                        <artifactId>
                                            maven-scr-plugin
                                        </artifactId>
                                        <versionRange>
                                            [1.0.0,)
                                        </versionRange>
                                        <goals>
                                            <goal>scr</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.5.3</version>
                    <configuration>
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                        <tagNameFormat>@{project.version}</tagNameFormat>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.3</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>

        <profile>
            <id>release</id>
            <activation>
                <property>
                    <name>performRelease</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <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>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>autoInstallBundle</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.sling</groupId>
                        <artifactId>maven-sling-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>install-bundle</id>
                                <goals>
                                    <goal>install</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <slingUrl>http://${crx.host}:${crx.port}/apps/netcentric/actool/install</slingUrl>
                            <usePut>true</usePut>
                        </configuration>                        
                    </plugin>
                </plugins>
            </build>
        </profile>

    </profiles>

</project>
