<?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.aem.commons</groupId>
    <artifactId>assetshare</artifactId>
    <packaging>pom</packaging>
    <version>3.13.0</version>

    <name>Asset Share Commons - Reactor Project</name>
    <description>asset-share-commons</description>

    <url>https://github.com/adobe/asset-share-commons</url>
    <inceptionYear>2017</inceptionYear>
    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <organization>
        <name>Adobe</name>
        <url>http://www.adobe.com/</url>
    </organization>

    <developers>
        <developer>
            <id>asset-share-commons</id>
            <organization>Adobe</organization>
            <organizationUrl>https://www.adobe.com</organizationUrl>
            <url>https://opensource.adobe.com/asset-share-commons/</url>
        </developer>
    </developers>

    <modules>
        <module>all</module>
        <module>core</module>
        <module>ui.config</module>
        <module>ui.frontend.theme.light</module>
        <module>ui.frontend.theme.dark</module>
        <module>ui.apps</module>
        <module>ui.apps.structure</module>
        <module>dispatcher</module>
        <module>ui.content</module>
        <module>ui.content.sample</module>
    </modules>

    <properties>
        <aem.host>localhost</aem.host>
        <aem.port>4502</aem.port>
        <aem.publish.host>localhost</aem.publish.host>
        <aem.publish.port>4503</aem.publish.port>
        <sling.user>admin</sling.user>
        <sling.password>admin</sling.password>
        <vault.user>admin</vault.user>
        <vault.password>admin</vault.password>
        <package.group>asset-share-commons</package.group>
        <!-- the minimum AEM 6.5 version being supported -->
        <aem.classic.api.version>6.5.19.0000</aem.classic.api.version><!-- actually one of https://repo1.maven.org/maven2/io/wcm/maven/io.wcm.maven.aem-dependencies/ -->
        <!-- the minimum AEMaaCS version being supported -->
        <aem.sdk.api.version>2025.5.21005.20250522T173058Z-250400</aem.sdk.api.version><!-- actually one of https://repo1.maven.org/maven2/com/adobe/aem/aem-sdk-api/ -->
        <core.wcm.components.version>2.17.14</core.wcm.components.version>
        <frontend-maven-plugin.version>1.9.0</frontend-maven-plugin.version>
        <node.version>v14.21.3</node.version>
        <npm.version>6.14.18</npm.version>
        <bnd.version>6.3.1</bnd.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.compiler.source>${maven.compiler.target}</maven.compiler.source>
    </properties>

    <scm>
        <connection>scm:git:https://github.com/adobe/asset-share-commons.git</connection>
        <developerConnection>scm:git:https://github.com/adobe/asset-share-commons.git</developerConnection>
        <url>https://github.com/adobe/asset-share-commons/tree/main</url>
        <tag>asset-share-commons-3.13.0</tag>
    </scm>

    <build>
        <plugins>
            <!-- Maven Central / OSS Sonatype Release 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>
                </configuration>
            </plugin>
            <!-- Maven Release Plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>3.1.1</version>
                <configuration>
                    <tagNameFormat>asset-share-commons-@{project.version}</tagNameFormat>
                    <scmCommentPrefix>[maven-scm] :</scmCommentPrefix>
                    <preparationGoals>clean install</preparationGoals>
                    <goals>install</goals>
                    <releaseProfiles>release</releaseProfiles>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <projectVersionPolicyId>OddEvenVersionPolicy</projectVersionPolicyId>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.release</groupId>
                        <artifactId>maven-release-oddeven-policy</artifactId>
                        <version>3.1.1</version>
                    </dependency>
                </dependencies>
            </plugin>
            <!-- Maven Source Plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.3.1</version>
                <inherited>true</inherited>
            </plugin>
            <!-- Maven Enforcer Plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.5.0</version>
                <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>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.github.eirslett</groupId>
                    <artifactId>frontend-maven-plugin</artifactId>
                    <version>1.15.4</version>
                    <configuration>
                        <nodeVersion>${node.version}</nodeVersion>
                        <npmVersion>${npm.version}</npmVersion>
                    </configuration>
                    <executions>
                        <execution>
                            <id>install node and npm</id>
                            <goals>
                                <goal>install-node-and-npm</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>npm install</id>
                            <goals>
                                <goal>npm</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <!-- Maven Jar Plugin -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.4.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <!-- DO NOT upgrade this version as it will break how Cloud Manager resolves symbolic links -->
                    <version>3.7.1</version>
                </plugin>
                <!-- Maven Clean Plugin -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>3.3.2</version>
                </plugin>
                <!-- BND Maven Plugin -->
                <plugin>
                    <groupId>biz.aQute.bnd</groupId>
                    <artifactId>bnd-maven-plugin</artifactId>
                    <version>${bnd.version}</version>
                    <configuration>
                        <bnd>
Bundle-Category: asset-share-commons
# export all versioned packages except for the conditional ones
-exportcontents: ${removeall;${packages;VERSIONED};${packages;CONDITIONAL}}
-snapshot: ${tstamp;yyyyMMddHHmmssSSS}
Bundle-DocURL: https://opensource.adobe.com/asset-share-commons/
-plugin org.apache.sling.caconfig.bndplugin.ConfigurationClassScannerPlugin
                        </bnd>
                    </configuration>
                    <executions>
                        <execution>
                            <id>bnd-process</id>
                            <goals>
                                <goal>bnd-process</goal>
                            </goals>
                        </execution>
                    </executions>
                    <dependencies>
                        <dependency>
                            <groupId>org.apache.sling</groupId>
                            <artifactId>org.apache.sling.caconfig.bnd-plugin</artifactId>
                            <version>1.0.2</version>
                        </dependency>
                        <dependency>
                            <groupId>org.apache.sling</groupId>
                            <artifactId>org.apache.sling.bnd.models</artifactId>
                            <version>1.0.0</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>biz.aQute.bnd</groupId>
                    <artifactId>bnd-baseline-maven-plugin</artifactId>
                    <version>${bnd.version}</version>
                    <executions>
                        <execution>
                            <id>baseline</id>
                            <goals>
                                <goal>baseline</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <!-- Maven Resources Plugin -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.3.1</version>
                </plugin>
                <!-- Maven Compiler Plugin -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.14.0</version>
                </plugin>
                <!-- Maven Installer Plugin -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>3.1.4</version>
                </plugin>
                <!-- Maven Surefire Plugin -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.3.1</version>
                    <dependencies>
                        <dependency>
                            <groupId>org.apache.maven.surefire</groupId>
                            <artifactId>surefire-junit47</artifactId>
                            <version>3.3.0</version>
                        </dependency>
                    </dependencies>
                    <configuration>
                        <parallel>methods</parallel>
                        <threadCount>5</threadCount>
                        <trimStackTrace>false</trimStackTrace>
                    </configuration>
                </plugin>
                <!-- Maven Failsafe Plugin -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>3.5.2</version>
                </plugin>
                <!-- Maven Deploy Plugin -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>3.1.1</version>
                </plugin>
                <!-- Apache Sling Plugin -->
                <plugin>
                    <groupId>org.apache.sling</groupId>
                    <artifactId>sling-maven-plugin</artifactId>
                    <version>3.0.4</version>
                    <configuration>
                        <slingUrl>http://${aem.host}:${aem.port}/system/console</slingUrl>
                        <deploymentMethod>WebConsole</deploymentMethod>
                    </configuration>
                </plugin>
                <!-- HTL Maven Plugin -->
                <plugin>
                    <groupId>org.apache.sling</groupId>
                    <artifactId>htl-maven-plugin</artifactId>
                    <version>2.0.4-1.4.0</version>
                    <configuration>
                        <failOnWarnings>true</failOnWarnings>
                        <allowedExpressionOptions>
                            <allowedExpressionOption>cssClassName</allowedExpressionOption>
                            <allowedExpressionOption>decoration</allowedExpressionOption>
                            <allowedExpressionOption>decorationTagName</allowedExpressionOption>
                            <allowedExpressionOption>wcmmode</allowedExpressionOption>
                        </allowedExpressionOptions>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>validate</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <!-- Jackrabbit FileVault Package Plugin -->
                <plugin>
                    <groupId>org.apache.jackrabbit</groupId>
                    <artifactId>filevault-package-maven-plugin</artifactId>
                    <version>1.4.0</version>
                    <extensions>true</extensions>
                    <configuration>
                        <filterSource>src/main/content/META-INF/vault/filter.xml</filterSource>
                        <validatorsSettings>
                            <jackrabbit-filter>
                                <options>
                                    <validRoots>/,/var,/tmp,/content,/content/dam,/home,/home/users,/home/users/system,/home/groups,/conf,/conf/global</validRoots>
                                </options>
                            </jackrabbit-filter>
                            <jackrabbit-docviewparser>
                                <options>
                                    <allowUndeclaredPrefixInFileName>true</allowUndeclaredPrefixInFileName>
                                </options>
                            </jackrabbit-docviewparser>
                            <jackrabbit-nodetypes>
                                <options>
                                    <cnds>tccl:aem.cnd</cnds>
                                </options>
                            </jackrabbit-nodetypes>
                        </validatorsSettings>
                        <properties>
                            <cloudManagerTarget>none</cloudManagerTarget>
                        </properties>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>biz.netcentric.aem</groupId>
                            <artifactId>aem-nodetypes</artifactId>
                            <version>6.5.7.0</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <!-- Content Package Plugin -->
                <plugin>
                    <groupId>com.day.jcr.vault</groupId>
                    <artifactId>content-package-maven-plugin</artifactId>
                    <version>1.0.6</version>
                    <configuration>
                        <targetURL>http://${aem.host}:${aem.port}/crx/packmgr/service.jsp</targetURL>
                        <failOnError>true</failOnError>
                        <userId>${vault.user}</userId>
                        <password>${vault.password}</password>
                        <verbose>true</verbose>
                        <failOnError>true</failOnError>
                    </configuration>
                </plugin>
                <!-- Maven Dependency Plugin -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>3.8.1</version>
                </plugin>
                <!-- Build Helper Maven Plugin -->
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>3.6.0</version>
                </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.maven.plugins</groupId>
                                        <artifactId>maven-enforcer-plugin</artifactId>
                                        <versionRange>[1.0.0,)</versionRange>
                                        <goals>
                                            <goal>enforce</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            org.apache.maven.plugins
                                        </groupId>
                                        <artifactId>
                                            maven-dependency-plugin
                                        </artifactId>
                                        <versionRange>
                                            [2.2,)
                                        </versionRange>
                                        <goals>
                                            <goal>copy-dependencies</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            org.codehaus.mojo
                                        </groupId>
                                        <artifactId>
                                            build-helper-maven-plugin
                                        </artifactId>
                                        <versionRange>
                                            [1.5,)
                                        </versionRange>
                                        <goals>
                                            <goal>
                                                reserve-network-port
                                            </goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
                <!-- Maven Javadoc Plugin -->
                <plugin>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.11.2</version>
                    <configuration>
                        <encoding>${project.build.sourceEncoding}</encoding>
                        <excludePackageNames>
                            *.impl
                        </excludePackageNames>
                    </configuration>
                </plugin>
                <!-- Maven Jacoco Plugin -->
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>0.8.12</version>
                </plugin>
                <!-- Maven PMD Plugin -->
                <plugin>
                    <artifactId>maven-pmd-plugin</artifactId>
                    <version>3.25.0</version>
                    <configuration>
                        <linkXRef>false</linkXRef>
                        <rulesets>
                            <ruleset>acs/pmd/rules.xml</ruleset>
                        </rulesets>
                        <targetJdk>1.8</targetJdk>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>com.adobe.acs</groupId>
                            <artifactId>coding-standards</artifactId>
                            <version>0.0.1</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <!-- Spotbugs Maven Plugin -->
                <plugin>
                    <groupId>com.github.spotbugs</groupId>
                    <artifactId>spotbugs-maven-plugin</artifactId>
                    <version>4.9.3.0</version>
                </plugin>
                <!-- Maven Checkstyle Plugin -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>3.6.0</version>
                    <configuration>
                        <linkXRef>false</linkXRef>
                        <configLocation>acs/checkstyle/checks.xml</configLocation>
                        <includeResources>false</includeResources>
                        <includeTestResources>false</includeTestResources>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>com.adobe.acs</groupId>
                            <artifactId>checkstyle-osgi-checks</artifactId>
                            <version>0.0.3</version>
                        </dependency>
                        <dependency>
                            <groupId>com.adobe.acs</groupId>
                            <artifactId>coding-standards</artifactId>
                            <version>0.0.1</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <!-- Maven JSLint Plugin -->
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>jslint-maven-plugin</artifactId>
                    <version>1.0.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>3.2.7</version>
                </plugin>
                <!-- Maven Central / OSS Sonatype release plugin -->
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>1.7.0</version>
                </plugin>
                <!-- checks for vulnerabilities in dependencies -->
                <plugin>
                    <groupId>org.owasp</groupId>
                    <artifactId>dependency-check-maven</artifactId>
                    <version>12.1.1</version>
                    <configuration>
                        <failBuildOnAnyVulnerability>true</failBuildOnAnyVulnerability>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>

        <!-- Development profile: install only the bundle -->
        <profile>
            <id>autoInstallBundle</id>
            <!--
                To enable this feature for a bundle, the sling-maven-plugin
                (without configuration) needs to be included:

                <plugin>
                    <groupId>org.apache.sling</groupId>
                    <artifactId>sling-maven-plugin</artifactId>
                 </plugin>
            -->
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <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>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.apache.jackrabbit</groupId>
                            <artifactId>filevault-package-maven-plugin</artifactId>
                            <executions>
                                <execution>
                                    <id>create-package</id>
                                    <goals>
                                        <goal>package</goal>
                                    </goals>
                                </execution>
                            </executions>
                        </plugin>
                        <plugin>
                            <groupId>com.day.jcr.vault</groupId>
                            <artifactId>content-package-maven-plugin</artifactId>
                            <executions>
                                <execution>
                                    <id>install-package</id>
                                    <goals>
                                        <goal>install</goal>
                                    </goals>
                                    <configuration>
                                        <targetURL>http://${aem.host}:${aem.port}/crx/packmgr/service.jsp</targetURL>
                                    </configuration>
                                </execution>
                            </executions>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>

        <profile>
            <id>autoInstallPackagePublish</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.apache.jackrabbit</groupId>
                            <artifactId>filevault-package-maven-plugin</artifactId>
                            <executions>
                                <execution>
                                    <id>create-package</id>
                                    <goals>
                                        <goal>package</goal>
                                    </goals>
                                </execution>
                            </executions>
                        </plugin>
                        <plugin>
                            <groupId>com.day.jcr.vault</groupId>
                            <artifactId>content-package-maven-plugin</artifactId>
                            <executions>
                                <execution>
                                    <id>install-package-publish</id>
                                    <goals>
                                        <goal>install</goal>
                                    </goals>
                                    <configuration>
                                        <targetURL>http://${aem.publish.host}:${aem.publish.port}/crx/packmgr/service.jsp</targetURL>
                                    </configuration>
                                </execution>
                            </executions>
                        </plugin>
                    </plugins>
                </pluginManagement>
            </build>
        </profile>

        <!-- Release profiles -->
        <profile>
            <id>release</id>
            <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>
                    <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>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>analysis</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-pmd-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>pmd</goal>
                                    <goal>cpd</goal>
                                    <!-- build will fail on warnings -->
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>javadoc</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>com.github.spotbugs</groupId>
                        <artifactId>spotbugs-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-checkstyle-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>checkstyle</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <!-- checks for vulnerabilities in dependencies -->
                        <groupId>org.owasp</groupId>
                        <artifactId>dependency-check-maven</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>analysisCI</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-pmd-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>pmd</goal>
                                    <goal>cpd</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>javadoc</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>com.github.spotbugs</groupId>
                        <artifactId>spotbugs-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>spotbugs</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-checkstyle-plugin</artifactId>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>checkstyle</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <!-- checks for vulnerabilities in dependencies -->
                        <groupId>org.owasp</groupId>
                        <artifactId>dependency-check-maven</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>jacoco-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>
                            </execution>
                            <execution>
                                <id>report</id>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>autoInstallPackage-all</id>
            <modules>
                <module>core</module>
                <!--<module>ui.config</module>-->
                <module>ui.apps</module>
                <module>ui.content</module>
            </modules>
        </profile>

        <!-- enable this profile to additionally build the packages/bundles for AEMaaCS, 
        the ones for AEM on prem are always built -->
        <profile>
            <id>cloud</id>
            <activation>
                <activeByDefault>false</activeByDefault>
                <property>
                    <name>env.CM_BUILD</name>
                </property>
            </activation>
            <modules>
                <module>core.cloud</module>
            </modules>
        </profile>
    </profiles>

    <!-- ====================================================================== -->
    <!-- D E P E N D E N C I E S -->
    <!-- ====================================================================== -->
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.adobe.aem</groupId>
                <artifactId>aem-sdk-api</artifactId>
                <version>${aem.sdk.api.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>io.wcm.maven</groupId>
                <artifactId>io.wcm.maven.aem-dependencies</artifactId>
                <version>${aem.classic.api.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>com.adobe.cq</groupId>
                <artifactId>core.wcm.components.core</artifactId>
                <version>${core.wcm.components.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>com.adobe.cq</groupId>
                <artifactId>core.wcm.components.content</artifactId>
                <version>${core.wcm.components.version}</version>
                <type>zip</type>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>com.google.code.findbugs</groupId>
                <artifactId>jsr305</artifactId>
                <version>3.0.0</version><!-- cannot use newer version due to https://github.com/amaembo/jsr-305/issues/31, todo: switch to Jetbrains annotation -->
                <scope>compile</scope>
            </dependency>
            <!-- JDK 11 -->
            <dependency>
                <artifactId>org.apache.sling.javax.activation</artifactId>
                <version>0.1.0</version>
                <groupId>org.apache.sling</groupId>
                <scope>provided</scope>
            </dependency>
            <!-- Testing -->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.13.2</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>junit-addons</groupId>
                <artifactId>junit-addons</artifactId>
                <version>1.4</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-simple</artifactId>
                <version>2.0.13</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>5.16.1</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.sling</groupId>
                <artifactId>org.apache.sling.testing.osgi-mock.junit4</artifactId>
                <version>3.5.2</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.sling</groupId>
                <artifactId>org.apache.sling.testing.sling-mock.junit4</artifactId>
                <version>3.4.10</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>io.wcm</groupId>
                <artifactId>io.wcm.testing.aem-mock.junit4</artifactId>
                <version>5.0.0</version>
                <scope>test</scope>
            </dependency>
            <!-- Require to resolve ServiceTracker in tests; else they fail -->
            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>org.osgi.util.tracker</artifactId>
                <version>1.5.2</version>
                <scope>test</scope>
            </dependency>
            <!-- Require to resolve OSGi Tacker Classes in tests; else they fail -->
            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>org.osgi.util.converter</artifactId>
                <version>1.0.9</version>
                <scope>test</scope>
            </dependency>
            <!-- Require to resolve ObjectConverter in tests; else they fail -->
            <dependency>
                <groupId>org.apache.sling</groupId>
                <artifactId>org.apache.sling.api</artifactId>
                <version>2.27.6</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <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>
</project>
