<?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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.atlassian.confluence</groupId>
        <artifactId>confluence-plugins</artifactId>
        <version>5.9.1-issue-CONF-38693-m2</version>
    </parent>

    <groupId>com.atlassian.confluence.plugins</groupId>
    <artifactId>confluence-bundled-plugins</artifactId>
    <packaging>pom</packaging>

    <name>Confluence Bundled Plugins</name>
    <description>Parent pom for Confluence's bundled plugins.</description>

    <modules>
        <!-- Bundled Plugins, in alphabetical order -->
        <module>confluence-api</module>
        <module>confluence-aui-staging</module>
        <module>confluence-content-property-storage</module>
        <module>confluence-darkfeatures-rest</module>
        <module>confluence-dashboard-actions</module>
        <module>confluence-dashboard-macros</module>
        <module>confluence-drag-and-drop</module>
        <module>confluence-eap-feature-switch</module>
        <module>confluence-easyuser-admin</module>
        <module>confluence-edge-index</module>
        <module>confluence-getting-started</module>
        <module>confluence-labels</module>
        <module>confluence-license-rest</module>
        <module>confluence-like</module>
        <module>confluence-lookandfeel</module>
        <module>confluence-macro-usage</module>
        <module>confluence-monitoring-console</module>
        <!--<module>confluence-multimedia-macros</module>-->
        <module>confluence-nav-links</module>
        <module>confluence-quick-reload</module>
        <module>confluence-quicknav</module>
        <module>confluence-required-health-checks</module>
        <module>confluence-page-restrictions-dialog</module>
        <module>confluence-rest-resources</module>
        <module>confluence-schedule-admin</module>
        <module>confluence-sortable-tables</module>
        <module>confluence-soy</module>
        <module>confluence-space-directory</module>
        <module>confluence-spaces</module>
        <module>confluence-tdm-merger</module>
        <module>confluence-templates</module>
        <module>confluence-ui-rest</module>
        <module>confluence-user-rest</module>
        <module>confluence-view-source</module>
        <module>confluence-analytics-whitelist</module>
        <module>confluence-monitoring</module>
        <module>doctheme</module>
        <module>system-templates</module>
  </modules>

    <build>
        <resources>
            <!-- This filtering strategy tricks the IDEA plugin into including the directory
                 in the classpath -->
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
                <includes>
                    <include>atlassian-plugin.xml</include>
                </includes>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>false</filtering>
                <excludes>
                    <exclude>atlassian-plugin.xml</exclude>
                </excludes>
            </resource>
        </resources>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.samaxes.maven</groupId>
                    <artifactId>minify-maven-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>minify-resources</id>
                            <configuration>
                                <jsSourceIncludes>
                                    <jsSourceInclude>**/*.js</jsSourceInclude>
                                </jsSourceIncludes>
                                <cssSourceIncludes>
                                    <cssSourceInclude>**/*.css</cssSourceInclude>
                                </cssSourceIncludes>
                                <cssSourceDir>.</cssSourceDir>
                                <jsSourceDir>.</jsSourceDir>
                                <webappSourceDir>${project.build.outputDirectory}</webappSourceDir>
                                <webappTargetDir>${project.build.outputDirectory}</webappTargetDir>
                                <jsEngine>CLOSURE</jsEngine>
                                <suffix>-min</suffix>
                                <skipMerge>true</skipMerge>
                                <closureLanguage>ECMASCRIPT5</closureLanguage>
                            </configuration>
                            <goals>
                                <goal>minify</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <!-- Use this artifact in plugins that have dependencies that need to be
                         compiled into the jar at build time. -->
                    <groupId>com.atlassian.maven.plugins</groupId>
                    <artifactId>maven-confluence-plugin</artifactId>
                    <configuration>
                        <closureJsCompiler>true</closureJsCompiler>
                        <skipAllPrompts>true</skipAllPrompts>
                        <extractDependencies>false</extractDependencies>
                        <productVersion>${project.version}</productVersion>
                        <productDataVersion>${confluence.data.version}</productDataVersion>
                        <parallel>true</parallel>
                        <systemPropertyVariables>
                            <confluence.context.batching.disable>true</confluence.context.batching.disable>
                            <plugin.webresource.batching.off>true</plugin.webresource.batching.off>
                        </systemPropertyVariables>
                    </configuration>
                </plugin>
                <!-- When using packaging "bundle" or "atlassian-plugin", we need to deploy the artifact as "jar".
                For more explanation, see BUILDENG-1506?focusedCommentId=216975#comment-216975-->
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>1.5</version>
                    <executions>
                        <execution>
                            <id>attach-bundle-artifact</id>
                            <phase>package</phase>
                            <goals>
                                <goal>attach-artifact</goal>
                            </goals>
                            <configuration>
                                <artifacts>
                                    <artifact>
                                        <file>${project.build.directory}/${project.build.finalName}.jar</file>
                                        <type>jar</type>
                                    </artifact>
                                </artifacts>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.twdata.maven</groupId>
                <artifactId>maven-cli-plugin</artifactId>
            </plugin>

            <!-- This is here because otherwise AMPS runs unit tests and ignores the "maven.unit.test.skip" property.
                 (see the surefire-plugin config in confluence-project <pluginManagement> -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.atlassian.confluence.plugins</groupId>
                <artifactId>confluence-notifications-api</artifactId>
                <version>${confluence-notifications.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>com.atlassian.plugin.notifications</groupId>
                <artifactId>notifications-api</artifactId>
                <version>${notifications.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>com.atlassian.confluence</groupId>
                <artifactId>confluence</artifactId>
                <version>${project.version}</version>
                <scope>provided</scope>
                <exclusions>
                    <!-- Ensure that wstx-asl is not packaged in the plugin jar -->
                    <exclusion>
                        <artifactId>wstx-asl</artifactId>
                        <groupId>org.codehaus.woodstox</groupId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>servlet-api</artifactId>
                <version>${servlet.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>com.atlassian.plugins.rest</groupId>
                <artifactId>atlassian-rest-common</artifactId>
                <version>${rest.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>com.atlassian.confluence.rest</groupId>
                <artifactId>confluence-rest-plugin</artifactId>
                <version>${project.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>javax.ws.rs</groupId>
                <artifactId>jsr311-api</artifactId>
                <version>1.1</version>
                <scope>provided</scope>
            </dependency>
            <!--
              While we export a different version of httpcore+httpclient to OSGi than we use elsewhere, plugins under
              confluence-bundled-plugins need to match the OSGi versions or explicitly bundle their own
             -->
            <dependency>
                <groupId>com.atlassian.confluence.plugin</groupId>
                <artifactId>func-test</artifactId>
                <version>2.6</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>com.atlassian.confluence.plugins</groupId>
                <artifactId>confluence-email-litmus-tests</artifactId>
                <version>${confluence-notifications.version}</version>
                <scope>test</scope>
                <exclusions>
                    <exclusion>
                        <groupId>junit</groupId>
                        <artifactId>junit</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>com.atlassian.selenium</groupId>
                        <artifactId>atlassian-webdriver-core</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>com.atlassian.confluence</groupId>
                        <artifactId>confluence-webdriver-support</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>com.atlassian.bundles</groupId>
                        <artifactId>jsr305</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>com.atlassian.confluence</groupId>
                <artifactId>jwebunit-confluence-plugin</artifactId>
                <version>${jwebunit.confluence.version}</version>
                <scope>test</scope>
                <exclusions>
                    <exclusion>
                        <groupId>junit</groupId>
                        <artifactId>junit</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <dependencies>
        <!-- These dependencies should come in useful for most plugins. Add another one
             iff it satisfies that condition - and make sure scope is 'provided'. -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- Dependencies for testing-->
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-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-dep</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <properties>
        <confluence.plugin.bundled>true</confluence.plugin.bundled>

        <!-- These properties should be pulled up to the parent pom -->
        <confluence.version>${project.version}</confluence.version>
        <confluence.data.version>${project.version}</confluence.data.version>
        <atlassian.product.version>${project.version}</atlassian.product.version>
        <atlassian.plugin.key>${project.groupId}.${project.artifactId}</atlassian.plugin.key>
    </properties>
</project>
