<?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">
    <parent>
        <artifactId>jira-workflow-designer-parent</artifactId>
        <groupId>com.atlassian.pom</groupId>
        <version>2.6.0-m6</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.atlassian.jira.plugins</groupId>
    <artifactId>workflow-designer-plugin</artifactId>
    <packaging>atlassian-plugin</packaging>
    <name>Workflow Designer Plugin</name>

    <build>
        <finalName>${project.artifactId}-${project.version}</finalName>

        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <excludes>
                    <exclude>atlassian-plugin.xml</exclude>
                </excludes>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
                <includes>
                    <include>atlassian-plugin.xml</include>
                    <include>**/*.vm</include>
                    <include>**/*.ftl</include>
                    <include>**/*.properties</include>
                </includes>
            </resource>
        </resources>
        <plugins>

            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>maven-jira-plugin</artifactId>
                <version>3.2.4</version>
                <extensions>true</extensions>
                <configuration>
                    <productVersion>${jira.version}</productVersion>
                    <productDataVersion>${jira.data.version}</productDataVersion>
                    <productDataPath>src/test/resources/!generated-test-resources.zip</productDataPath>
                </configuration>
            </plugin>

            <plugin>
                <groupId>com.keyboardsamurais.maven</groupId>
                <artifactId>maven-timestamp-plugin</artifactId>
                <version>1.0</version>
                <configuration>
                    <propertyName>builddate</propertyName>
                    <timestampPattern>MM/dd/yyyy</timestampPattern>
                </configuration>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>create</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.1</version>
            </plugin>

            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.4.1</version>
                <executions>
                    <execution>
                        <id>copy-status-icons</id>

                        <phase>generate-resources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.outputDirectory}/status-icons/</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>${basedir}/../flex-designer/src/main/resources/assets/status</directory>
                                    <filtering>false</filtering>
                                    <includes>
                                        <include>*_med.png</include>
                                    </includes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.4.1</version>
                <executions>
                    <execution>
                        <id>copy-flex-resources</id>

                        <phase>compile</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.outputDirectory}/templates/flex/</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>${basedir}/../flex-designer/target</directory>
                                    <filtering>false</filtering>
                                    <includes>
                                        <include>*.swf</include>
                                    </includes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>


            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.4.1</version>
                <executions>
                    <execution>
                        <id>copy-buildutils</id>

                        <phase>generate-sources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${build.directory}/generated-sources/sysbliss</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>${project.basedir}/src/main/etc</directory>
                                    <filtering>true</filtering>
                                    <includes>
                                        <include>**/BuildInfo.java</include>
                                    </includes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.4</version>
                <executions>
                    <execution>
                        <id>add-source</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${build.directory}/generated-sources/sysbliss</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>net.sf.alchim</groupId>
                <artifactId>yuicompressor-maven-plugin</artifactId>
		<version>0.7.1</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>compress</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <!-- Everything on one line -->
                    <linebreakpos>-1</linebreakpos>
                    <!-- Don't really care about warning messages.  They're fairly useless -->
                    <jswarn>false</jswarn>
                    <excludes>
                        <exclude>**/*.xml</exclude>
                        <exclude>**/*.vm</exclude>
                        <exclude>**/*.properties</exclude>
                        <exclude>**/*min.*</exclude>
                    </excludes>
                </configuration>
            </plugin>

        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>jira-workflow-gui-model</artifactId>
            <version>${project.version}</version>
            <scope>compile</scope>
        </dependency>

        <!--<dependency>
            <groupId>jgraph</groupId>
            <artifactId>jgraph</artifactId>
            <version>5.13.0.0</version>
            <scope>compile</scope>
        </dependency>-->

        <dependency>
            <groupId>jgraphx</groupId>
            <artifactId>jgraphx</artifactId>
            <version>1.5.1.8</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.4</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-core</artifactId>
            <version>${jira.compile.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.jira</groupId>
            <artifactId>jira-api</artifactId>
            <version>${jira.compile.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.8.2</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>httpunit</groupId>
            <artifactId>httpunit</artifactId>
            <version>1.7</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>1.7</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-api</artifactId>
            <version>2.4.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-core-asl</artifactId>
            <version>1.3.0</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-mapper-asl</artifactId>
            <version>1.3.0</version>
            <scope>compile</scope>
        </dependency>

        <!-- AMF Dependencies -->
        <dependency>
            <groupId>com.exadel.flamingo.flex</groupId>
            <artifactId>amf-serializer</artifactId>
            <version>2.2.0</version>
            <exclusions>
                <exclusion>
                    <groupId>commons-beanutils</groupId>
                    <artifactId>commons-beanutils</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.exadel.flamingo</groupId>
            <artifactId>flamingo-service-spring</artifactId>
            <version>2.2.0</version>
            <exclusions>
                <exclusion>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-validator</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-annotations</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.hibernate</groupId>
                    <artifactId>hibernate-commons-annotations</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.persistence</groupId>
                    <artifactId>persistence-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>2.5.5</version>
            <scope>provided</scope>
        </dependency>

    </dependencies>

    <profiles>
        <profile>
            <id>pseudo-loc</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.atlassian.maven.plugins</groupId>
                        <artifactId>pseudo-loc-maven-plugin</artifactId>
                        <version>1.0</version>
                        <executions>
                            <execution>
                                <id>pseudo-loc</id>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>pseudo-loc</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <sourceLocale>en_US</sourceLocale>
                            <targetLocale>en_AQ</targetLocale>
                            <pseudoLocaliseActions>
                                <pseudoLocaliseAction>
                                    <source>src/main/resources/i18n/i18n.properties</source>
                                    <target>src/main/resources/i18n/i18n_{loc}.properties</target>
                                </pseudoLocaliseAction>
                            </pseudoLocaliseActions>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
