<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.jira</groupId>
        <artifactId>jira-plugins</artifactId>
        <version>9.12.30</version>
    </parent>

    <artifactId>jira-platform-bundles</artifactId>

    <name>Atlassian Jira - Platform Bundles</name>
    <packaging>pom</packaging>

    <build>
        <plugins>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>smartass-maven-plugin</artifactId>
                <version>${smartass.version}</version>
                <executions>
                    <execution>
                        <id>list-framework-bundles-artifacts</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>generate-artifact-list</goal>
                        </goals>
                        <configuration>
                            <attach>true</attach>
                            <excludeArtifactIds>${bundled.plugins.excluded.artifacts}</excludeArtifactIds>
                            <includeScope>provided</includeScope>
                        </configuration>
                    </execution>
                    <execution>
                        <id>list-framework-bundles-files</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>generate-files-list</goal>
                        </goals>
                        <configuration>
                            <includeScope>provided</includeScope>
                            <excludeArtifactIds>${bundled.plugins.excluded.artifacts}</excludeArtifactIds>
                            <listFileName>${project.artifactId}.list</listFileName>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <executions>
                    <execution>
                        <id>require_provided_dependencies</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <phase>validate</phase>
                        <configuration>
                            <rules>
                                <bannedDependencies>
                                    <searchTransitive>true</searchTransitive>
                                    <message>Bundled plugins must have _provided_ scope to be properly bundled. Using
                                        _compile_ or _runtime_ will end up in WEB-INF/lib
                                    </message>
                                    <excludes>
                                        <!-- group:artifact:version:package:scope -->
                                        <exclude>*:*:*:*:compile</exclude>
                                        <exclude>*:*:*:*:runtime</exclude>
                                    </excludes>
                                </bannedDependencies>
                            </rules>
                            <fail>true</fail>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <finalName>atlassian-bundled-plugins</finalName>
    </build>

    <properties>
    </properties>

    <dependencyManagement>
        <dependencies>
            <!-- import jira-api-bom to get potential overrides -->
            <dependency>
                <groupId>com.atlassian.jira</groupId>
                <artifactId>jira-api-bom</artifactId>
                <version>${project.version}</version>
                <scope>import</scope>
                <type>pom</type>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-osgi-bridge</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-osgi-spring-extender</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse.gemini.blueprint</groupId>
            <artifactId>gemini-blueprint-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse.gemini.blueprint</groupId>
            <artifactId>gemini-blueprint-extender</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse.gemini.blueprint</groupId>
            <artifactId>gemini-blueprint-io</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.platform.dependencies</groupId>
            <artifactId>platform-spring-bundle</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.servicemix.bundles</groupId>
            <artifactId>org.apache.servicemix.bundles.velocity</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.platform</groupId>
            <artifactId>spring-velocity-support</artifactId>
            <scope>provided</scope>
        </dependency>
    </dependencies>

</project>
