<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.atlassian.bitbucket.server</groupId>
        <artifactId>bitbucket-webapp-parent</artifactId>
        <version>8.19.0-rc3</version>
    </parent>

    <artifactId>bitbucket-webapp</artifactId>
    <packaging>war</packaging>

    <name>Bitbucket Server - Web Application</name>
    <url>https://www.atlassian.com/software/bitbucket/server</url>

    <properties>
        <timestamp>${maven.build.timestamp}</timestamp>
        <exclude.tests>com/atlassian/bitbucket/internal/it/**/*.java</exclude.tests>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.atlassian.bitbucket.server</groupId>
            <artifactId>bitbucket-api</artifactId>
        </dependency>
        <!-- Bundle the P1 build plugin - 'runtime' scope because nothing should be using its code directly -->
        <dependency>
            <groupId>com.atlassian.bitbucket.server</groupId>
            <artifactId>bitbucket-build-feature</artifactId>
            <scope>runtime</scope>
        </dependency>
        <!-- Bundle the P1 build plugin - 'runtime' scope because nothing should be using its code directly -->
        <dependency>
            <groupId>com.atlassian.bitbucket.server</groupId>
            <artifactId>bitbucket-deployments</artifactId>
            <scope>runtime</scope>
        </dependency>
        <!-- This dependency is here to ensure parallel compilation builds bundled plugins before the webapp.
             Removing this dependency will break parallel builds. -->
        <dependency>
            <groupId>com.atlassian.bitbucket.server</groupId>
            <artifactId>bitbucket-bundled-plugins</artifactId>
            <type>txt</type>
            <scope>provided</scope>
        </dependency>
        <!-- Bundle the P1 build plugin - 'runtime' scope because nothing should be using its code directly -->
        <dependency>
            <groupId>com.atlassian.bitbucket.server</groupId>
            <artifactId>bitbucket-code-owners</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.bitbucket.server</groupId>
            <artifactId>bitbucket-dao-impl</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.bitbucket.server</groupId>
            <artifactId>bitbucket-dmz-api</artifactId>
        </dependency>
        <!-- All Git modules are in runtime scope because nothing should be
             using the Git-specific APIs directly -->
        <dependency>
            <groupId>com.atlassian.bitbucket.server</groupId>
            <artifactId>bitbucket-git-api</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.bitbucket.server</groupId>
            <artifactId>bitbucket-git-common</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.bitbucket.server</groupId>
            <artifactId>bitbucket-git</artifactId>
            <scope>runtime</scope>
        </dependency>
        <!-- Bundle the P1 http client plugin - 'runtime' scope because nothing should be using its code directly -->
        <dependency>
            <groupId>com.atlassian.bitbucket.server</groupId>
            <artifactId>bitbucket-http-client</artifactId>
            <scope>runtime</scope>
        </dependency>
        <!-- Bundle the P1 in-product diagnostics plugin -->
        <dependency>
            <groupId>com.atlassian.bitbucket.server</groupId>
            <artifactId>bitbucket-ipd</artifactId>
            <scope>compile</scope>
        </dependency>
        <!-- Bundle the P1 labels plugin - 'runtime' scope because nothing should be using its code directly -->
        <dependency>
            <groupId>com.atlassian.bitbucket.server</groupId>
            <artifactId>bitbucket-labels</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.bitbucket.server</groupId>
            <artifactId>bitbucket-model</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.bitbucket.server</groupId>
            <artifactId>bitbucket-platform</artifactId>
        </dependency>
        <!-- This dependency is here to ensure it is built in Maven "also make" mode. -->
        <dependency>
            <groupId>com.atlassian.bitbucket.server</groupId>
            <artifactId>bitbucket-plugin-extender</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.bitbucket.server</groupId>
            <artifactId>bitbucket-process</artifactId>
        </dependency>
        <!-- Bundle the P1 rate limit plugin - 'runtime' scope because nothing should be using its code directly -->
        <dependency>
            <groupId>com.atlassian.bitbucket.server</groupId>
            <artifactId>bitbucket-rate-limit</artifactId>
            <scope>runtime</scope>
        </dependency>
        <!-- Bundle the P1 repository management plugin - 'runtime' scope because nothing should be using its code directly -->
        <dependency>
            <groupId>com.atlassian.bitbucket.server</groupId>
            <artifactId>bitbucket-repository-management</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.bitbucket.server</groupId>
            <artifactId>bitbucket-scm-cache</artifactId>
            <scope>runtime</scope>
        </dependency>
        <!-- Bundle the P1 build plugin - 'runtime' scope because nothing should be using its code directly -->
        <dependency>
            <groupId>com.atlassian.bitbucket.server</groupId>
            <artifactId>bitbucket-secret-scanning</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.bitbucket.server</groupId>
            <artifactId>bitbucket-service-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.bitbucket.server</groupId>
            <artifactId>bitbucket-service-impl</artifactId>
            <scope>runtime</scope>
        </dependency>
        <!-- Bundle the P1 suggestions plugin - 'runtime' scope because nothing should be using its code directly -->
        <dependency>
            <groupId>com.atlassian.bitbucket.server</groupId>
            <artifactId>bitbucket-suggestions</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.bitbucket.server</groupId>
            <artifactId>bitbucket-util</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.bitbucket.server</groupId>
            <artifactId>bitbucket-web-common</artifactId>
        </dependency>
        <!-- Bundle the P1 X.509 plugin - 'runtime' scope because nothing should be using its code directly -->
        <dependency>
            <groupId>com.atlassian.bitbucket.server</groupId>
            <artifactId>bitbucket-x509</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.bitbucket.server.swagger</groupId>
            <artifactId>annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.beehive</groupId>
            <artifactId>beehive-hazelcast5</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.cache</groupId>
            <artifactId>atlassian-cache-hazelcast</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.hazelcast</groupId>
            <artifactId>atlassian-hazelcast-extras-osgi</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.cache</groupId>
            <artifactId>atlassian-cache-memory</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.secrets</groupId>
            <artifactId>atlassian-secrets-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.secrets</groupId>
            <artifactId>atlassian-secrets-store</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.diagnostics</groupId>
            <artifactId>atlassian-diagnostics-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.diagnostics</groupId>
            <artifactId>atlassian-diagnostics-core</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.healthcheck</groupId>
            <artifactId>atlassian-healthcheck-spi</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.http</groupId>
            <artifactId>atlassian-http</artifactId>
        </dependency>
        <!-- The host app exports Http Client API to ensure classes are available by both core and
             OSGi for P2 plugins. -->
        <dependency>
            <groupId>com.atlassian.httpclient</groupId>
            <artifactId>atlassian-httpclient-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.johnson</groupId>
            <artifactId>atlassian-johnson-core</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.johnson</groupId>
            <artifactId>atlassian-johnson-plugins</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.johnson</groupId>
            <artifactId>atlassian-johnson-spring</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.json</groupId>
            <artifactId>atlassian-json-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-client-resource</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-core</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-webfragment</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-webresource</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.security</groupId>
            <artifactId>atlassian-secure-utils</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.security.serialblocklist</groupId>
            <artifactId>serialblocklist</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.security.java8.objectfilter</groupId>
            <artifactId>java8-objectfilter</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.security.objectfilter</groupId>
            <artifactId>java11-objectfilter</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.soy</groupId>
            <artifactId>soy-template-renderer-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.soy</groupId>
            <artifactId>atlassian-soy-spring-mvc-support</artifactId>
        </dependency>
        <!--
        Yes we are including a plugin as a runtime library  dependency! It is very intentional.
        To avoid running into plugin startup concurrency issues we are exposing the compatibility
        implementation of the tenant APIs from the host application.
        -->
        <dependency>
            <groupId>com.atlassian.tenancy</groupId>
            <artifactId>atlassian-tenancy-compatibility-plugin</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.theme</groupId>
            <artifactId>atlassian-theme-library</artifactId>
            <scope>compile</scope>
        </dependency>
        <!-- Deprecated in 6.0 for removal in 9.0 -->
        <dependency>
            <groupId>com.atlassian.util.concurrent</groupId>
            <artifactId>atlassian-util-concurrent</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.uri</groupId>
            <artifactId>atlassian-uri</artifactId>
        </dependency>
        <!-- The host app exports the webhooks API and SPI over OSGi to ensure the classes are available even when the
             atlassian-webhooks-plugin is not bundled, such as in mirror deployments. This is necessary
             because the bitbucket-rest plugin references webhooks classes and Jersey would fail to initialize all
             REST resources if the webhooks classes were missing. -->
        <dependency>
            <groupId>com.atlassian.webhooks</groupId>
            <artifactId>atlassian-webhooks-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.webhooks</groupId>
            <artifactId>atlassian-webhooks-spi</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-collections</groupId>
            <artifactId>commons-collections</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-fileupload</groupId>
            <artifactId>commons-fileupload</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
        </dependency>
        <dependency>
            <groupId>com.jhlabs</groupId>
            <artifactId>filters</artifactId>
        </dependency>
        <dependency>
            <groupId>com.hazelcast</groupId>
            <artifactId>hazelcast</artifactId>
        </dependency>
        <dependency>
            <groupId>com.hazelcast</groupId>
            <artifactId>hazelcast-wm</artifactId>
        </dependency>
        <dependency>
            <groupId>com.octo.captcha</groupId>
            <artifactId>jcaptcha-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.octo.captcha</groupId>
            <artifactId>jcaptcha</artifactId>
        </dependency>
        <dependency>
            <groupId>org.dom4j</groupId>
            <artifactId>dom4j</artifactId>
        </dependency>
        <dependency>
            <groupId>io.swagger.core.v3</groupId>
            <artifactId>swagger-jaxrs2</artifactId>
        </dependency>
        <dependency>
            <groupId>jaxen</groupId>
            <artifactId>jaxen</artifactId>
        </dependency>

        <!-- Database drivers -->
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.hsqldb</groupId>
            <artifactId>hsqldb</artifactId>
            <classifier>jdk8</classifier>
            <scope>runtime</scope>
        </dependency>

        <!-- Java EE no longer provided by Java 11 -->
        <dependency>
            <groupId>javax.annotation</groupId>
            <artifactId>javax.annotation-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.sun.activation</groupId>
            <artifactId>javax.activation</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jaxb</groupId>
            <artifactId>jaxb-runtime</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>jsr311-api</artifactId>
        </dependency>

        <!-- Provided by Servlet Container -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <!-- Provided by Servlet Container -->
        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>jsp-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <!-- Provided by Servlet Container -->
        <dependency>
            <groupId>javax.el</groupId>
            <artifactId>javax.el-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
        </dependency>
        <dependency>
            <groupId>opensymphony</groupId>
            <artifactId>sitemesh</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-el</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-websocket</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-jasper</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.velocity</groupId>
            <artifactId>velocity</artifactId>
        </dependency>
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-mapper-asl</artifactId>
        </dependency>
        <dependency>
            <groupId>org.codehaus.janino</groupId>
            <artifactId>janino</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jul-to-slf4j</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-autoconfigure</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.ip</groupId>
            <artifactId>atlassian-ip</artifactId>
        </dependency>
        <dependency>
            <groupId>com.zaxxer</groupId>
            <artifactId>HikariCP</artifactId>
        </dependency>
        <dependency>
            <groupId>org.tuckey</groupId>
            <artifactId>urlrewritefilter</artifactId>
        </dependency>

        <dependency>
            <groupId>com.atlassian.bitbucket.server</groupId>
            <artifactId>bitbucket-test-util</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
        </dependency>
        <dependency>
            <groupId>com.atlassian.hazelcast</groupId>
            <artifactId>hazelcast-spring-test-util</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.el</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-library</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>vault</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>localstack</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>docsversion-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>smartass-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-bundled-plugins</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>copy-listed-artifacts</goal>
                        </goals>
                        <configuration>
                            <sourceList>${project.build.directory}/bitbucket-bundled-plugins.txt</sourceList>
                            <targetDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/atlassian-bundled-plugins</targetDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <!-- This AnnotationProcessor enables the use of Spring Boot's @ConfigurationProperties.
                         It generates "META-INF/spring-configuration-metadata.json" -->
                    <annotationProcessors>
                        <processor>org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor</processor>
                    </annotationProcessors>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>org.springframework.boot</groupId>
                            <artifactId>spring-boot-configuration-processor</artifactId>
                            <version>${spring.boot.libversion}</version>
                        </path>
                    </annotationProcessorPaths>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-bundled-plugins-list</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <includeArtifactIds>bitbucket-bundled-plugins</includeArtifactIds>
                            <outputDirectory>${project.build.directory}</outputDirectory>
                            <stripVersion>true</stripVersion>
                        </configuration>
                    </execution>
                    <execution>
                        <id>copy-framework-bundles</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <!-- The Gemini Blueprint artifacts -->
                                <artifactItem>
                                    <groupId>org.eclipse.gemini.blueprint</groupId>
                                    <artifactId>gemini-blueprint-core</artifactId>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.eclipse.gemini.blueprint</groupId>
                                    <artifactId>gemini-blueprint-extender</artifactId>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.eclipse.gemini.blueprint</groupId>
                                    <artifactId>gemini-blueprint-io</artifactId>
                                </artifactItem>

                                <!-- The Spring framework -->
                                <artifactItem>
                                    <groupId>com.atlassian.platform.dependencies</groupId>
                                    <artifactId>platform-spring-bundle</artifactId>
                                </artifactItem>

                                <!-- Spring Dependencies -->
                                <artifactItem>
                                    <groupId>org.apache.servicemix.bundles</groupId>
                                    <artifactId>org.apache.servicemix.bundles.cglib</artifactId>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.servicemix.bundles</groupId>
                                    <artifactId>org.apache.servicemix.bundles.javax-inject</artifactId>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.servicemix.bundles</groupId>
                                    <artifactId>org.apache.servicemix.bundles.velocity</artifactId>
                                </artifactItem>

                                <!-- Plugin Framework -->
                                <artifactItem>
                                    <groupId>com.atlassian.plugins</groupId>
                                    <artifactId>atlassian-plugins-osgi-bridge</artifactId>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>com.atlassian.plugins</groupId>
                                    <artifactId>atlassian-plugins-osgi-spring-extender</artifactId>
                                </artifactItem>

                                <!-- OSGi Compendium implementation -->
                                <artifactItem>
                                    <groupId>org.apache.felix</groupId>
                                    <artifactId>org.osgi.compendium</artifactId>
                                </artifactItem>

                                <!-- Bitbucket Server specific plugin extender -->
                                <!-- This should also be declared as a provided dependency to make sure it is built
                                     by Maven in "also make" mode -->
                                <artifactItem>
                                    <groupId>com.atlassian.bitbucket.server</groupId>
                                    <artifactId>bitbucket-plugin-extender</artifactId>
                                </artifactItem>

                                <!-- 3rd party libs -->
                                <artifactItem>
                                    <groupId>commons-pool</groupId>
                                    <artifactId>commons-pool</artifactId>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>commons-lang</groupId>
                                    <artifactId>commons-lang</artifactId>
                                </artifactItem>
                            </artifactItems>
                            <outputDirectory>
                                ${project.build.directory}/${project.build.finalName}/WEB-INF/osgi-framework-bundles
                            </outputDirectory>
                        </configuration>
                    </execution>
                    <execution>
                        <id>copy-mesh</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>com.atlassian.bitbucket.mesh</groupId>
                                    <artifactId>mesh-app</artifactId>
                                </artifactItem>
                            </artifactItems>
                            <outputDirectory>
                                ${project.build.directory}/${project.build.finalName}/WEB-INF/mesh
                            </outputDirectory>
                            <stripVersion>true</stripVersion>
                        </configuration>
                    </execution>
                    <execution>
                        <id>unpack-loader</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.springframework.boot</groupId>
                                    <artifactId>spring-boot-loader</artifactId>
                                </artifactItem>
                            </artifactItems>
                            <outputDirectory>${project.build.directory}/${project.build.finalName}</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <id>ban-jakarta</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <phase>validate</phase>
                        <configuration>
                            <rules>
                                <bannedDependencies>
                                    <excludes>
                                        <exclude>jakarta.annotation:*:*</exclude>
                                        <exclude>org.glassfish:jakarta.el:*</exclude>
                                    </excludes>
                                    <message>Jakarta EE dependencies cannot be used.</message>
                                    <searchTransitive>true</searchTransitive>
                                </bannedDependencies>
                            </rules>
                            <fail>true</fail>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <additionalClasspathElements> <!--bring the webapp resources (urlrewrite.xml, etc.) in the test classpath-->
                        <additionalClasspathElement>${basedir}/src/main/webapp/</additionalClasspathElement>
                    </additionalClasspathElements>
                    <excludes>
                        <exclude>${exclude.tests}</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                        </manifest>
                        <manifestEntries>
                            <Spring-Boot-Classes>WEB-INF/classes/</Spring-Boot-Classes>
                            <Spring-Boot-Lib>WEB-INF/lib/</Spring-Boot-Lib>
                            <Spring-Boot-Version>${spring.boot.libversion}</Spring-Boot-Version>
                            <Start-Class>com.atlassian.bitbucket.internal.boot.BitbucketServerApplication</Start-Class>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.github.eirslett</groupId>
                <artifactId>frontend-maven-plugin</artifactId>
                <configuration>
                    <workingDirectory>../../</workingDirectory>
                    <installDirectory>../../${fe.node.installdir}</installDirectory>
                    <environmentVariables>
                        <BABEL_ENV>production</BABEL_ENV>
                    </environmentVariables>
                </configuration>
                <executions>
                    <execution>
                        <id>gulp build</id>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                        <phase>generate-resources</phase>
                        <configuration>
                            <arguments>run gulp core:build</arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.atlassian.minify</groupId>
                <artifactId>minify-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>compress-frontend-resources</id>
                        <goals>
                            <goal>minify-webresources</goal>
                        </goals>
                        <configuration combine.self="override"> <!-- override the config for plugins in the root pom -->
                            <resourceBaseDirectory>${project.build.directory}/${project.build.finalName}</resourceBaseDirectory>
                            <pluginXmlFiles>
                                <pluginXmlFile>${basedir}/src/main/resources/bitbucket-plugin.xml</pluginXmlFile>
                                <pluginXmlFile>${basedir}/src/main/resources/bitbucket-plugins/client-web-fragments.xml</pluginXmlFile>
                                <pluginXmlFile>${basedir}/src/main/resources/bitbucket-plugins/feature-announcement-banner.xml</pluginXmlFile>
                                <pluginXmlFile>${basedir}/src/main/resources/bitbucket-plugins/page-data.xml</pluginXmlFile>
                                <pluginXmlFile>${basedir}/src/main/resources/bitbucket-plugins/web-api.xml</pluginXmlFile>
                                <pluginXmlFile>${project.build.directory}/classes/bitbucket-plugins/highlight.xml</pluginXmlFile>
                            </pluginXmlFiles>
                            <outputDirectory>${project.build.directory}/${project.build.finalName}</outputDirectory>
                            <minifierLogLevel>ERROR</minifierLogLevel>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>buildnumber-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>get-commit-hash</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>create</goal>
                        </goals>
                        <configuration>
                            <buildNumberPropertyName>commitHash</buildNumberPropertyName>
                            <revisionOnScmFailure>${buildNumber}</revisionOnScmFailure>
                            <scmBranchPropertyName>commitBranch</scmBranchPropertyName>
                            <timestampPropertyName>commitTimestamp</timestampPropertyName>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>amps-maven-plugin</artifactId>
                <version>${amps.libversion}</version>
                <executions>
                    <execution>
                        <id>copy-fe-module-manifests</id>
                        <goals>
                            <goal>copy-fe-module-manifests</goal>
                        </goals>
                        <configuration>
                            <includedFeModuleManifests>
                                <includedFeModuleManifest>${project.basedir}/../../package.json</includedFeModuleManifest>
                                <includedFeModuleManifest>${project.basedir}/../../package-lock.json</includedFeModuleManifest>
                            </includedFeModuleManifests>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <!-- Runs on the release (and checks) build only -->
            <id>bom</id>
            <build>
                <plugins>
                    <!-- Generate the bom -->
                    <plugin>
                        <groupId>com.atlassian.maven.plugins</groupId>
                        <artifactId>license-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>generate-sources</id>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>bom</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>com.atlassian.maven.plugins</groupId>
                        <artifactId>maven-licensing-bom-processor-plugin</artifactId>
                        <version>0.3</version>
                        <executions>
                            <execution>
                                <id>generate-sources</id>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>generate</goal>
                                </goals>
                                <configuration>
                                    <bom>${project.build.directory}/bom.csv</bom>
                                    <template>${basedir}/src/build/resources/static/bitbucketLicenseTemplates.soy</template>
                                    <templateName>com.atlassian.bitbucket.distribution.licenseTemplates</templateName>
                                    <output>${project.build.directory}/${project.artifactId}-${project.version}/static/page/about/licenses.soy</output>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <!-- Used to launch the gogo shell to aid with debugging -->
            <!-- Never, never ever use in production -->
            <id>gogo</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>copy-felix-gogo-shell</id>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>copy</goal>
                                </goals>
                                <configuration>
                                    <artifactItems>
                                        <artifactItem>
                                            <groupId>org.apache.felix</groupId>
                                            <artifactId>org.apache.felix.gogo.runtime</artifactId>
                                            <version>0.16.2</version>
                                        </artifactItem>
                                        <artifactItem>
                                            <groupId>org.apache.felix</groupId>
                                            <artifactId>org.apache.felix.gogo.command</artifactId>
                                            <version>0.14.0</version>
                                        </artifactItem>
                                        <artifactItem>
                                            <groupId>org.apache.felix</groupId>
                                            <artifactId>org.apache.felix.shell.remote</artifactId>
                                            <version>1.1.2</version>
                                        </artifactItem>
                                        <artifactItem>
                                            <groupId>org.apache.felix</groupId>
                                            <artifactId>org.apache.felix.gogo.shell</artifactId>
                                            <version>0.10.0</version>
                                        </artifactItem>
                                    </artifactItems>
                                <outputDirectory>
                                    ${project.build.directory}/${project.build.finalName}/WEB-INF/framework-bundles
                                </outputDirectory>
                            </configuration>
                        </execution>
                    </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>real-database</id>
            <activation>
                <property>
                    <!-- IDEA's maven server will set this system property, so we can use it to automatically enable this profile inside the IDE
                    See https://github.com/JetBrains/intellij-community/blob/idea/193.5662.53/plugins/maven/src/main/java/org/jetbrains/idea/maven/server/MavenServerManager.java#L727 -->
                    <name>idea.maven.embedder.version</name>
                </property>
            </activation>
            <dependencies>
                <!-- The JDBC driver dependencies are used for development, but cannot be bundled into the
                     war. The JDBC drivers are handled specially when building the distribution. -->
                <dependency>
                    <groupId>com.microsoft.sqlserver</groupId>
                    <artifactId>mssql-jdbc</artifactId>
                    <scope>runtime</scope>
                </dependency>
                <dependency>
                    <groupId>com.oracle.jdbc</groupId>
                    <artifactId>ojdbc8</artifactId>
                    <scope>runtime</scope>
                </dependency>
                <dependency>
                    <groupId>mysql</groupId>
                    <artifactId>mysql-connector-java</artifactId>
                    <scope>runtime</scope>
                </dependency>
                <dependency>
                    <groupId>org.postgresql</groupId>
                    <artifactId>postgresql</artifactId>
                    <scope>runtime</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>it.webapp</id>
            <properties>
                <exclude.tests>nothing-to-exclude</exclude.tests>
            </properties>
        </profile>
    </profiles>
</project>
