<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-ondemand-project</artifactId>
        <version>6.2-pipeline-23</version>
    </parent>

    <artifactId>jira-ondemand-plugins</artifactId>
    <packaging>pom</packaging>
    <name>Atlassian JIRA - OnDemand - Plugins</name>
    
    <modules>
      <module>jira-ondemand-repository-manager-plugin</module>
      <module>jira-ondemand-svn-importer-plugin</module>
      <module>jira-ondemand-theme-plugin</module>
      <module>jira-ondemand-ual-plugin</module>
      <module>jira-ondemand-haup-plugin-components</module>
    </modules>
    
    <properties>
        <atlassian.plugin.application.version.min>4.3</atlassian.plugin.application.version.min>
        <atlassian.plugin.application.version.max>4.3</atlassian.plugin.application.version.max>
        <atlassian.product.version>${project.version}</atlassian.product.version>
        <atlassian.pdk.server.url>http://localhost:2990/jira</atlassian.pdk.server.url>
        <atlassian.pdk.server.username>sysadmin</atlassian.pdk.server.username>
        <atlassian.pdk.server.password>sysadmin</atlassian.pdk.server.password>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>atlassian-pdk</artifactId>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <!-- when using packaging=bundle we need to attach the bundle artifact to the build -->
                <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>
                <plugin>
                    <groupId>org.twdata.maven</groupId>
                    <artifactId>maven-cli-plugin</artifactId>
                    <version>1.0.4</version>
                    <configuration>
                        <commands>
                            <pi>clean resources compile jar org.apache.felix:maven-bundle-plugin:bundle com.atlassian.maven.plugins:atlassian-pdk:install</pi>
                            <pu>com.atlassian.maven.plugins:atlassian-pdk:uninstall</pu>
                            <package>clean resources compile jar</package>
                        </commands>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

</project>
