<?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.plugins</groupId>
        <artifactId>atlassian-plugins-parent</artifactId>
        <version>5.3.14</version>
    </parent>

    <artifactId>atlassian-plugins-framework-bundles</artifactId>
    <packaging>pom</packaging>

    <name>Atlassian Plugins - Framework Bundles</name>
    <description>
        Creates framework bundle archives for products
    </description>

    <properties>
        <commonBundles>${project.build.directory}/common-bundles</commonBundles>
        <spring50xBundles>${project.build.directory}/spring50x-bundles</spring50xBundles>
        <spring51xBundles>${project.build.directory}/spring51x-bundles</spring51xBundles>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-osgi-spring-extender</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-osgi-bridge</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-common-bundles</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <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>
                                <artifactItem>
                                    <groupId>org.apache.servicemix.bundles</groupId>
                                    <artifactId>org.apache.servicemix.bundles.aopalliance</artifactId>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.servicemix.bundles</groupId>
                                    <artifactId>org.apache.servicemix.bundles.velocity</artifactId>
                                    <version>${velocityBundleVersion}</version>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>javax.validation</groupId>
                                    <artifactId>validation-api</artifactId>
                                </artifactItem>
                            </artifactItems>
                            <outputDirectory>${commonBundles}</outputDirectory>
                        </configuration>
                    </execution>
                    <execution>
                        <id>copy-internal-framework-bundles</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${commonBundles}</outputDirectory>
                            <includeArtifactIds>
                                atlassian-plugins-osgi-bridge,
                                atlassian-plugins-osgi-spring-extender
                            </includeArtifactIds>
                        </configuration>
                    </execution>
                    <execution>
                        <id>copy-spring50x-bundles</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.apache.servicemix.bundles</groupId>
                                    <artifactId>org.apache.servicemix.bundles.spring-core</artifactId>
                                    <version>${spring50xBundleVersion}</version>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.servicemix.bundles</groupId>
                                    <artifactId>org.apache.servicemix.bundles.spring-expression</artifactId>
                                    <version>${spring50xBundleVersion}</version>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.servicemix.bundles</groupId>
                                    <artifactId>org.apache.servicemix.bundles.spring-beans</artifactId>
                                    <version>${spring50xBundleVersion}</version>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.servicemix.bundles</groupId>
                                    <artifactId>org.apache.servicemix.bundles.spring-aop</artifactId>
                                    <version>${spring50xBundleVersion}</version>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.servicemix.bundles</groupId>
                                    <artifactId>org.apache.servicemix.bundles.spring-context</artifactId>
                                    <version>${spring50xBundleVersion}</version>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.servicemix.bundles</groupId>
                                    <artifactId>org.apache.servicemix.bundles.spring-context-support</artifactId>
                                    <version>${spring50xBundleVersion}</version>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.servicemix.bundles</groupId>
                                    <artifactId>org.apache.servicemix.bundles.spring-web</artifactId>
                                    <version>${spring50xBundleVersion}</version>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.servicemix.bundles</groupId>
                                    <artifactId>org.apache.servicemix.bundles.spring-webmvc</artifactId>
                                    <version>${spring50xBundleVersion}</version>
                                </artifactItem>
                            </artifactItems>
                            <outputDirectory>${spring50xBundles}</outputDirectory>
                        </configuration>
                    </execution>
                    <execution>
                        <id>copy-spring51x-bundles</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.apache.servicemix.bundles</groupId>
                                    <artifactId>org.apache.servicemix.bundles.spring-core</artifactId>
                                    <version>${spring51xBundleVersion}</version>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.servicemix.bundles</groupId>
                                    <artifactId>org.apache.servicemix.bundles.spring-expression</artifactId>
                                    <version>${spring51xBundleVersion}</version>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.servicemix.bundles</groupId>
                                    <artifactId>org.apache.servicemix.bundles.spring-beans</artifactId>
                                    <version>${spring51xBundleVersion}</version>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.servicemix.bundles</groupId>
                                    <artifactId>org.apache.servicemix.bundles.spring-aop</artifactId>
                                    <version>${spring51xBundleVersion}</version>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.servicemix.bundles</groupId>
                                    <artifactId>org.apache.servicemix.bundles.spring-context</artifactId>
                                    <version>${spring51xBundleVersion}</version>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.servicemix.bundles</groupId>
                                    <artifactId>org.apache.servicemix.bundles.spring-context-support</artifactId>
                                    <version>${spring51xBundleVersion}</version>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.servicemix.bundles</groupId>
                                    <artifactId>org.apache.servicemix.bundles.spring-web</artifactId>
                                    <version>${spring51xBundleVersion}</version>
                                </artifactItem>
                                <artifactItem>
                                    <groupId>org.apache.servicemix.bundles</groupId>
                                    <artifactId>org.apache.servicemix.bundles.spring-webmvc</artifactId>
                                    <version>${spring51xBundleVersion}</version>
                                </artifactItem>
                            </artifactItems>
                            <outputDirectory>${spring51xBundles}</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <id>create-spring50x-bundle</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <finalName>framework-bundle</finalName>
                            <descriptors>
                                <descriptor>src/main/assembly/spring50x.xml</descriptor>
                            </descriptors>
                            <attach>true</attach>
                        </configuration>
                    </execution>
                    <execution>
                        <id>create-spring51x-bundle</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <finalName>framework-bundle</finalName>
                            <descriptors>
                                <descriptor>src/main/assembly/spring51x.xml</descriptor>
                            </descriptors>
                            <attach>true</attach>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
