<?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.psmq</groupId>
        <artifactId>atlassian-psmq-parent</artifactId>
        <version>5.8.0-QR-0007</version>
    </parent>

    <artifactId>psmq-plugin</artifactId>
    <packaging>atlassian-plugin</packaging>

    <name>psmq-plugin</name>
    <description>PSMQ - Provides Pretty Simple Message Queueing</description>

    <properties>
        <maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm:ss.SSSZ</maven.build.timestamp.format>
        <timestamp>${maven.build.timestamp}</timestamp>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.atlassian.pocketknife</groupId>
            <artifactId>jira-pocketknife-enablement</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.psmq</groupId>
            <artifactId>psmq-api</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.psmq</groupId>
            <artifactId>psmq-common</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.psmq</groupId>
            <artifactId>psmq-core</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.activeobjects</groupId>
            <artifactId>activeobjects-plugin</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugin</groupId>
            <artifactId>atlassian-spring-scanner-annotation</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.scheduler</groupId>
            <artifactId>atlassian-scheduler-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <scope>compile</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>buildnumber-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>com.atlassian.util</groupId>
                <artifactId>db-schema-translator-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>com.atlassian.labs</groupId>
                <artifactId>maven-versionator</artifactId>
                <version>1.2</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>versionate</goal>
                        </goals>
                        <phase>validate</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.atlassian.plugin</groupId>
                <artifactId>atlassian-spring-scanner-maven-plugin</artifactId>
                <version>${atlassian.spring.scanner.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>atlassian-spring-scanner</goal>
                        </goals>
                        <phase>prepare-package</phase>
                        <!-- process-classes seems to be skipped for scala -->
                    </execution>
                </executions>
                <configuration>
                    <!-- Turn this on to true to show the inner workings of the build time scanner -->
                    <verbose>false</verbose>
                    <scannedDependencies>
                        <dependency>
                            <groupId>com.atlassian.psmq</groupId>
                            <artifactId>psmq-core</artifactId>
                        </dependency>
                        <dependency>
                            <groupId>com.atlassian.pocketknife</groupId>
                            <artifactId>atlassian-pocketknife-querydsl</artifactId>
                        </dependency>
                        <dependency>
                            <groupId>com.atlassian.pocketknife</groupId>
                            <artifactId>jira-pocketknife-enablement</artifactId>
                        </dependency>
                    </scannedDependencies>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <!-- Generate build properties -->
                    <execution>
                        <id>generate-build-properties</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target>
                                <taskdef resource="net/sf/antcontrib/antcontrib.properties"
                                         classpathref="maven.plugin.classpath"/>
                                <echo>Running ant tasks. Suck on that maven!</echo>
                                <echo>Generating BuildProperties.properties...</echo>
                                <copy file="${project.basedir}/src/main/resources/buildprops/BuildProperties.properties.template"
                                      tofile="${project.build.outputDirectory}/buildprops/BuildProperties.properties"
                                      overwrite="true"/>
                                <replace file="${project.build.outputDirectory}/buildprops/BuildProperties.properties"
                                         token="%PSMQ_BUILD_DATE@" value="${timestamp}"/>
                                <replace file="${project.build.outputDirectory}/buildprops/BuildProperties.properties"
                                         token="%PSMQ_VERSION@" value="${project.version}"/>
                                <replace file="${project.build.outputDirectory}/buildprops/BuildProperties.properties"
                                         token="%PSMQ_CHANGE_SET@" value="${buildNumber}"/>
                            </target>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>ant-contrib</groupId>
                        <artifactId>ant-contrib</artifactId>
                        <version>1.0b3</version>
                        <exclusions>
                            <exclusion>
                                <groupId>ant</groupId>
                                <artifactId>ant</artifactId>
                            </exclusion>
                        </exclusions>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>jira-maven-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <processI18nUsage>false</processI18nUsage>
                    <productVersion>${jira.version}</productVersion>
                    <productDataVersion>${jira.data.version}</productDataVersion>
                    <enableDevToolbox>false</enableDevToolbox>
                    <enablePde>false</enablePde>
                    <skipRestDocGeneration>true</skipRestDocGeneration>
                    <allowGoogleTracking>false</allowGoogleTracking>
                    <skipManifestValidation>true</skipManifestValidation>
                    <extractDependencies>false</extractDependencies>
                    <skipManifestValidation>true</skipManifestValidation>
                    <!-- install database drivers - they go into WEB-INF/lib -->

                    <instructions>
                        <Atlassian-Plugin-Key>com.atlassian.psmq</Atlassian-Plugin-Key>
                        <Bundle-SymbolicName>com.atlassian.psmq</Bundle-SymbolicName>
                        <Spring-Context>*</Spring-Context>
                        <!-- Specifies the location of standard plugin modules to scan -->
                        <Atlassian-Scan-Folders>META-INF/plugin-descriptors</Atlassian-Scan-Folders>
                        <Export-Package>
                            com.atlassian.psmq.api,
                            com.atlassian.psmq.api.*,
                            com.atlassian.psmq.spi,
                            com.atlassian.psmq.spi.*,

                            <!--Testing only -->
                            com.atlassian.psmq.internal.visiblefortesting
                        </Export-Package>
                        <Import-Package><!-- Platform 4 use Gemini while the old uses SpringDM -->
                            org.springframework.*;resolution:="optional",
                            org.eclipse.gemini.blueprint.*;resolution:="optional",

                            <!-- reflection based -->
                            org.apache.log4j;resolution:="optional",

                            javax.annotation,

                            com.atlassian.psmq.api,
                            com.atlassian.psmq.api.*,
                            com.atlassian.psmq.spi,
                            com.atlassian.psmq.spi.*,

                            !net.sf.cglib.proxy,
                            !org.jvnet.hudson.annotation_indexer,

                            <!-- let bind discover the rest -->
                            *
                        </Import-Package>
                    </instructions>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
