<?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>3.2.0</version>
    <packaging>pom</packaging>

    <name>Access Control Tool</name>
    <description>Maven Multimodule project for Access Control Tool.</description>
    <url>https://github.com/Netcentric/accesscontroltool</url>
    <inceptionYear>2015</inceptionYear>
    <organization>
        <name>Cognizant Netcentric</name>
        <url>https://www.netcentric.biz/</url>
    </organization>
    <developers>
        <developer>
            <name>Georg Henzler</name>
            <email>georg.henzler@netcentric.biz</email>
            <id>georg.henzler@netcentric.biz</id>
            <organization>Netcentric</organization>
            <organizationUrl>https://www.netcentric.biz/</organizationUrl>
        </developer>
        <developer>
            <name>Konrad Windszus</name>
            <email>konrad.windszus@netcentric.biz</email>
            <id>konrad.windszus@netcentric.biz</id>
            <organization>Netcentric</organization>
            <organizationUrl>https://www.netcentric.biz/</organizationUrl>
        </developer>
    </developers>
    <ciManagement>
        <system>github</system>
        <url>https://github.com/Netcentric/accesscontroltool/actions/workflows/maven.yml</url>
    </ciManagement>
    <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>3.2.0</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>

    <!-- ====================================================================== -->
    <!-- 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.25</slf4j.version>
        <bnd.version>6.4.0</bnd.version>
        <bouncycastle.version>1.64</bouncycastle.version>
        <!-- release sets API classpath, source and target, see  https://docs.oracle.com/javase/9/tools/javac.htm#GUID-AEEC9F07-CB49-4E96-8BC7-BCC2C7F725C9__GUID-D343F6B4-3FDD-43A8-AD24-43DD70214471  and http://openjdk.java.net/jeps/247 -->
        <maven.compiler.release>8</maven.compiler.release>
        <mockito.version>4.8.0</mockito.version>
        <junit.version>5.10.0</junit.version>
        <!-- default content package file to install on AEM -->
        <contentPackageFile>${project.build.directory}/${project.build.finalName}.zip</contentPackageFile>
    </properties>

    <modules>
        <module>target-osgi-environment</module>
        <module>accesscontroltool-bundle</module>
        <module>accesscontroltool-startuphook-bundle</module>
        <module>accesscontroltool-apps-package</module>
        <module>accesscontroltool-content-package</module>
        <module>accesscontroltool-package</module>
        <module>accesscontroltool-oakindex-package</module>
        <module>accesscontroltool-exampleconfig-package</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <!-- Runtime dependencies should be AEM 6.4 compatible -->
            <dependency>
                <groupId>io.wcm.maven</groupId>
                <artifactId>io.wcm.maven.aem-dependencies</artifactId>
                <version>6.4.0.0004</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!-- embedded 3rd party dependencies -->
            <dependency>
                <groupId>org.yaml</groupId>
                <artifactId>snakeyaml</artifactId>
                <version>2.2</version>
            </dependency>
            <!-- due to https://bugs.openjdk.java.net/browse/JDK-8231581 OOTB JRE is not sufficient -->
            <dependency>
                <groupId>org.bouncycastle</groupId>
                <artifactId>bcpkix-jdk15on</artifactId>
                <version>${bouncycastle.version}</version>
                <scope>provided</scope>
            </dependency>
            <!-- testing dependencies -->
            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit-bom</artifactId>
                <version>${junit.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-library</artifactId>
                <version>2.2</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-junit-jupiter</artifactId>
                <version>${mockito.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-simple</artifactId>
                <version>${slf4j.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>biz.aQute.bnd</groupId>
                    <artifactId>bnd-maven-plugin</artifactId>
                    <version>${bnd.version}</version>
                    <configuration>
                        <bnd>
                            Bundle-DocURL: https://github.com/Netcentric/accesscontroltool
                            # generate error (instead of warning) when exported package uses private (non-exported) reference
                            -fixupmessages:"Export *, has \\d+, private references";\
                            restrict:=warning;\
                            is:=error
                        </bnd>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>bnd-process</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>biz.aQute.bnd</groupId>
                    <artifactId>bnd-baseline-maven-plugin</artifactId>
                    <version>${bnd.version}</version>
                </plugin>
                <plugin>
                    <groupId>biz.aQute.bnd</groupId>
                    <artifactId>bnd-resolver-maven-plugin</artifactId>
                    <version>${bnd.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.4.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.13.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>3.4.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.3.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>3.1.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>3.7.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>3.1.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.3.1</version>
                    <dependencies>
                        <dependency>
                            <groupId>org.junit.jupiter</groupId>
                            <artifactId>junit-jupiter-engine</artifactId>
                            <version>${junit.version}</version>
                        </dependency>
                        <dependency>
                            <groupId>org.junit.vintage</groupId>
                            <artifactId>junit-vintage-engine</artifactId>
                            <version>${junit.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>3.3.1</version>
                    <dependencies>
                        <dependency>
                            <groupId>org.junit.jupiter</groupId>
                            <artifactId>junit-jupiter-engine</artifactId>
                            <version>${junit.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.7.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.3.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>3.2.4</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>3.5.0</version>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>1.7.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.sling</groupId>
                    <artifactId>sling-maven-plugin</artifactId>
                    <version>3.0.2</version>
                    <configuration>
                        <user>${crx.username}</user>
                        <password>${crx.password}</password>
                        <slingUrl>http://${crx.host}:${crx.port}</slingUrl>
                        <slingUrlSuffix>/system/console</slingUrlSuffix>
                    </configuration>
                </plugin>
                <!-- for building content packages -->
                <plugin>
                    <groupId>org.apache.jackrabbit</groupId>
                    <artifactId>filevault-package-maven-plugin</artifactId>
                    <version>1.3.6</version>
                    <extensions>true</extensions>
                    <configuration>
                        <group>Netcentric</group>
                        <filterSource>src/main/META-INF/vault/filter.xml</filterSource>
                        <validatorsSettings>
                            <jackrabbit-filter>
                                <options>
                                    <validRoots>
                                        /,/libs,/libs/core/wcm,/apps,/apps/netcentric,/apps/netcentric/actool,/etc,/etc/packages,/tmp,/content,/oak:index
                                    </validRoots>
                                </options>
                            </jackrabbit-filter>
                            <jackrabbit-nodetypes>
                                <options>
                                    <!-- use the nodetypes and namespaces from the aem-nodetypes.jar provided in the plugin dependencies -->
                                    <cnds>tccl:aem.cnd</cnds>
                                </options>
                            </jackrabbit-nodetypes>
                            <netcentric-aem-classification>
                                <defaultSeverity>WARN</defaultSeverity>
                                <options>
                                    <severitiesPerClassification>INTERNAL_DEPRECATED=WARN</severitiesPerClassification>
                                    <maps>
                                        tccl:biz/netcentric/filevault/validator/maps/aem-classification-map-deprecations/coral2deprecations.map,tccl:biz/netcentric/filevault/validator/maps/aem-classification-map-deprecations/graniteuideprecations.map,tccl:biz/netcentric/filevault/validator/maps/aem-classification-map-repo-annotations.map
                                    </maps>
                                </options>
                            </netcentric-aem-classification>
                            <netcentric-aem-cloud>
                                <options>
                                    <allowVarNodeOutsideContainer>false
                                    </allowVarNodeOutsideContainer><!-- default value is true, as it is allowed to have /var nodes inside author-only container -->
                                </options>
                            </netcentric-aem-cloud>
                        </validatorsSettings>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>biz.netcentric.filevault.validator</groupId>
                            <artifactId>aem-classification-validator</artifactId>
                            <version>1.1.1</version>
                        </dependency>
                        <!-- the dependency containing the actual classification map -->
                        <dependency>
                            <groupId>biz.netcentric.filevault.validator.maps</groupId>
                            <artifactId>aem-classification-map-repo-annotations</artifactId>
                            <version>6.5.13.0</version>
                        </dependency>
                        <dependency>
                            <groupId>biz.netcentric.filevault.validator.maps</groupId>
                            <artifactId>aem-classification-map-deprecations</artifactId>
                            <version>6.5.0.0</version>
                        </dependency>
                        <dependency>
                            <groupId>biz.netcentric.aem</groupId>
                            <artifactId>aem-nodetypes</artifactId>
                            <version>6.5.7.0</version>
                        </dependency>
                        <!-- https://github.com/Netcentric/aem-cloud-validator -->
                        <dependency>
                            <groupId>biz.netcentric.filevault.validator</groupId>
                            <artifactId>aem-cloud-validator</artifactId>
                            <version>1.3.0</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>osgicheck-maven-plugin</artifactId>
                    <version>0.1.0</version>
                    <executions>
                        <execution>
                            <id>check-bundle</id>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <!-- for deploying to AEM -->
                <plugin>
                    <groupId>com.day.jcr.vault</groupId>
                    <artifactId>content-package-maven-plugin</artifactId>
                    <version>1.0.6</version>
                    <configuration>
                        <failOnError>true</failOnError>
                        <userId>${crx.username}</userId>
                        <password>${crx.password}</password>
                        <!-- this should either point to the primary artifact file or a secondary one. There is no direct "classifier" support in this maven plugin -->
                        <packageFile>${contentPackageFile}</packageFile>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>com.adobe.aem</groupId>
                    <artifactId>aemanalyser-maven-plugin</artifactId>
                    <version>1.5.12</version>
                    <executions>
                        <execution>
                            <id>aem-analyser</id>
                            <goals>
                                <goal>project-analyse</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>3.1.0</version>
                    <configuration>
                        <releaseProfiles>release,cloud</releaseProfiles>
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                        <tagNameFormat>@{project.version}</tagNameFormat>
                        <!-- skip rebuilding the release with GitHub actions (https://github.blog/changelog/2021-02-08-github-actions-skip-pull-request-and-push-workflows-with-skip-ci/) -->
                        <scmReleaseCommitComment>@{prefix} prepare release @{releaseLabel} [skip ci]
                        </scmReleaseCommitComment>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.owasp</groupId>
                    <artifactId>dependency-check-maven</artifactId>
                    <version>10.0.2</version>
                    <configuration>
                        <failBuildOnCVSS>11</failBuildOnCVSS>
                        <skipProvidedScope>true</skipProvidedScope>
                        <skipSystemScope>true</skipSystemScope>
                        <retireJsAnalyzerEnabled>false</retireJsAnalyzerEnabled>
                        <skip>true</skip><!-- only enable in specific submodules -->
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>0.8.12</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>2.4.0</version>
                    <configuration>
                        <licenseName>epl_only_v1</licenseName>
                        <excludes>test/resources/**,it/**</excludes>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <id>enforce-maven-and-java</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>3.6.1</version>
                                </requireMavenVersion>
                                <requireJavaVersion>
                                    <version>11</version>
                                </requireJavaVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>check-license-header</id>
                        <goals>
                            <goal>check-file-header</goal>
                        </goals>
                        <phase>validate</phase>
                        <configuration>
                            <failOnMissingHeader>true</failOnMissingHeader>
                            <failOnNotUptodateHeader>true</failOnNotUptodateHeader>
                            <ignoreNoFileToScan>true</ignoreNoFileToScan>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- https://github.com/sonatype/nexus-maven-plugins/tree/master/staging/maven-plugin -->
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <stagingProgressTimeoutMinutes>20</stagingProgressTimeoutMinutes>
                    <keepStagingRepositoryOnCloseRuleFailure>true</keepStagingRepositoryOnCloseRuleFailure>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <!-- https://central.sonatype.org/pages/requirements.html -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <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>
                        <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>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>autoInstallBundle</id>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.apache.sling</groupId>
                            <artifactId>sling-maven-plugin</artifactId>
                            <executions>
                                <execution>
                                    <id>install-bundle</id>
                                    <goals>
                                        <goal>install</goal>
                                    </goals>
                                </execution>
                            </executions>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
        <profile>
            <id>autoInstallPackage</id>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>com.day.jcr.vault</groupId>
                            <artifactId>content-package-maven-plugin</artifactId>
                            <executions>
                                <execution>
                                    <id>install-content-package</id>
                                    <phase>install</phase>
                                    <goals>
                                        <goal>install</goal>
                                    </goals>
                                    <configuration>
                                        <targetURL>http://${crx.host}:${crx.port}/crx/packmgr/service.jsp</targetURL>
                                        <username>${crx.username}</username>
                                        <password>${crx.password}</password>
                                    </configuration>
                                </execution>
                            </executions>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
        <profile>
            <id>autoInstallPackagePublish</id>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>com.day.jcr.vault</groupId>
                            <artifactId>content-package-maven-plugin</artifactId>
                            <executions>
                                <execution>
                                    <id>install-content-package-publish</id>
                                    <phase>install</phase>
                                    <goals>
                                        <goal>install</goal>
                                    </goals>
                                    <configuration>
                                        <targetURL>http://${publish.crx.host}:${publish.crx.port}/crx/packmgr/service.jsp</targetURL>
                                        <userId>${publish.crx.username}</userId>
                                        <password>${publish.crx.password}</password>
                                    </configuration>
                                </execution>
                            </executions>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>
        <profile>
            <id>dependency-check</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.owasp</groupId>
                        <artifactId>dependency-check-maven</artifactId>
                        <executions>
                            <execution>
                                <id>check-dependencies-for-vulnerabilities</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>coverage-report</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>prepare-agent</id>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                                <configuration>
                                    <append>true</append>
                                    <destFile>${project.build.directory}/jacoco-ut.exec</destFile>
                                    <propertyName>jacoco.ut.command</propertyName>
                                </configuration>
                            </execution>
                            <execution>
                                <id>prepare-agent-integration</id>
                                <goals>
                                    <goal>prepare-agent-integration</goal>
                                </goals>
                                <configuration>
                                    <append>true</append>
                                    <destFile>${project.build.directory}/jacoco-it.exec</destFile>
                                    <propertyName>jacoco.it.command</propertyName>
                                </configuration>
                            </execution>
                            <execution>
                                <id>report</id>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                                <configuration>
                                    <dataFile>${project.build.directory}/jacoco-ut.exec</dataFile>
                                    <outputDirectory> ${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>report-integration</id>
                                <goals>
                                    <goal>report-integration</goal>
                                </goals>
                                <configuration>
                                    <dataFile>${project.build.directory}/jacoco-it.exec</dataFile>
                                    <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
                                </configuration>
                            </execution>
                            <execution>
                                <id>merge-unit-and-it</id>
                                <phase>post-integration-test</phase>
                                <goals>
                                    <goal>merge</goal>
                                </goals>
                                <configuration>
                                    <destFile>${project.build.directory}/jacoco-merged.exec</destFile>
                                    <fileSets>
                                        <fileSet>
                                            <directory>${project.build.directory}</directory>
                                            <includes>
                                                <include>jacoco-ut.exec</include>
                                                <include>jacoco-it.exec</include>
                                            </includes>
                                        </fileSet>
                                    </fileSets>
                                </configuration>
                            </execution>
                            <execution>
                                <id>report-merged</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                                <configuration>
                                    <dataFile>${project.build.directory}/jacoco-merged.exec</dataFile>
                                    <!-- use default output file path for SonarQube to pick it up automatically -->
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-surefire-plugin</artifactId>
                            <configuration>
                                <argLine>${jacoco.ut.command}</argLine>
                            </configuration>
                        </plugin>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-failsafe-plugin</artifactId>
                            <configuration>
                                <argLine>${jacoco.it.command}</argLine>
                                <systemPropertyVariables>
                                    <!--
                                    for IT where you need a forked JVM to run the tests you can use this system property to make sure that
                                    the JaCoCo agent correctly instruments your code
                                     -->
                                    <jacoco.it.command>${jacoco.it.command}</jacoco.it.command>
                                </systemPropertyVariables>
                            </configuration>
                        </plugin>
                    </plugins>
                 </pluginManagement>
            </build>
        </profile>
        <profile>
            <id>integration-tests</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>integration-test</goal>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <!-- build packages for cloud (as secondary artifacts with classifier "cloud") and install those to AEM instead when leveraging content-package-maven-plugin -->
            <id>cloud</id>
            <!-- automatically active on CI -->
            <activation>
                <property>
                    <name>env.CI</name>
                </property>
            </activation>
            <properties>
                <!-- install package with "cloud" classifier to AEM -->
                <contentPackageFile>${project.build.directory}/${project.build.finalName}-cloud.zip</contentPackageFile>
            </properties>
        </profile>
    </profiles>

</project>
