<?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/maven-v4_0_0.xsd">

    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.atlassian.mywork</groupId>
        <artifactId>mywork-project</artifactId>
        <version>6.0.1</version>
    </parent>
    <artifactId>mywork-confluence-host-plugin</artifactId>

    <name>Workbox - Host Plugin</name>
    <description>Provides persistence and rendering for Workbox</description>
    <packaging>atlassian-plugin</packaging>

    <dependencies>
        <dependency>
            <groupId>com.atlassian.mywork</groupId>
            <artifactId>mywork-api</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.mywork</groupId>
            <artifactId>mywork-common-plugin</artifactId>
            <version>${project.version}</version>
            <type>atlassian-plugin</type>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.mywork</groupId>
            <artifactId>mywork-jira-provider-plugin</artifactId>
            <version>${project.version}</version>
            <type>atlassian-plugin</type>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.mywork</groupId>
            <artifactId>mywork-confluence-provider-plugin</artifactId>
            <version>${project.version}</version>
            <type>atlassian-plugin</type>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-servlet</artifactId>
            <version>${atlassian-plugins.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.plugins.rest</groupId>
            <artifactId>atlassian-rest-common</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
            <version>1.0.0.GA</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.oauth</groupId>
            <artifactId>atlassian-oauth-api</artifactId>
            <version>${oauth.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-nav-links-plugin</artifactId>
            <version>${atlassian-nav-links.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.analytics</groupId>
            <artifactId>analytics-api</artifactId>
            <version>${analytics.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.fugue</groupId>
            <artifactId>fugue</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.4</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.templaterenderer</groupId>
            <artifactId>atlassian-template-renderer-api</artifactId>
            <version>${atlassian-template-renderer.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.seraph</groupId>
            <artifactId>atlassian-seraph</artifactId>
            <version>${seraph.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.owasp.antisamy</groupId>
            <artifactId>antisamy</artifactId>
            <version>1.4.2-atlassian-13</version>
            <type>jar</type>
            <exclusions>
                <exclusion>
                    <groupId>commons-httpclient</groupId>
                    <artifactId>commons-httpclient</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>net.sourceforge.nekohtml</groupId>
                    <artifactId>nekohtml</artifactId>
                </exclusion>
                <exclusion>
                    <artifactId>xml-apis</artifactId>
                    <groupId>xml-apis</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>xml-apis-ext</artifactId>
                    <groupId>xml-apis</groupId>
                </exclusion>
                 <exclusion>
                    <artifactId>commons-logging</artifactId>
                    <groupId>commons-logging</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>commons-httpclient</groupId>
            <artifactId>commons-httpclient</artifactId>
            <version>${commons-httpclient.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.xmlgraphics</groupId>
            <artifactId>batik-css</artifactId>
            <version>1.7</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>xerces</groupId>
            <artifactId>xercesImpl</artifactId>
            <version>2.9.1</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-webresource-api</artifactId>
            <version>${atlassian-plugins-webresource.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.usercompatibility</groupId>
            <artifactId>usercompatibility-confluence</artifactId>
            <version>2.1.3</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-library</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- Active Objects dependencies -->
        <dependency>
            <groupId>com.atlassian.activeobjects</groupId>
            <artifactId>activeobjects-plugin</artifactId>
            <version>${ao.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.activeobjects</groupId>
            <artifactId>activeobjects-test</artifactId>
            <version>${ao.version}</version>
            <scope>test</scope>
        </dependency>

        <!-- Confluence dependency -->
        <dependency>
            <groupId>com.atlassian.confluence</groupId>
            <artifactId>confluence</artifactId>
            <version>${confluence.version}</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-log4j12</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.atlassian.beehive</groupId>
            <artifactId>beehive-core</artifactId>
            <version>0.1.3</version>
            <scope>test</scope>
        </dependency>

        <!-- for some obscure reason it needs to be a module dep and not just a dep of the antrun plugin (ask Min'an) -->
        <dependency>
            <groupId>com.atlassian.plugins.rest</groupId>
            <artifactId>atlassian-rest-doclet</artifactId>
            <scope>provided</scope>
            <version>${atlassian-rest.version}</version>
        </dependency>

        <!-- These need to be here just for REST documentation -->
        <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-api</artifactId>
            <scope>provided</scope>
            <version>${sal.api.version}</version>
        </dependency>

        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-core-asl</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-mapper-asl</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.applinks</groupId>
            <artifactId>applinks-api</artifactId>
            <version>${applinks.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.applinks</groupId>
            <artifactId>applinks-spi</artifactId>
            <version>${applinks.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.applinks</groupId>
            <artifactId>applinks-host</artifactId>
            <version>${applinks.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.google.template.soy</groupId>
            <artifactId>soycompiler</artifactId>
            <version>20140422.18-atlassian3</version>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>com.atlassian.vcache</groupId>
            <artifactId>atlassian-vcache-api</artifactId>
            <scope>provided</scope>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>maven-amps-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <systemPropertyVariables>
                        <xvfb.enable>${xvfb.enable}</xvfb.enable>
                    </systemPropertyVariables>

                    <instructions>
                        <Export-Package>
                            com.atlassian.mywork.host.service,
                        </Export-Package>
                        <Import-Package>
                            com.atlassian.confluence.plugin.descriptor.mail,
                            com.atlassian.activeobjects.external;version="${ao.compatibility.version}",
                            com.atlassian.activeobjects.tx;version="${ao.compatibility.version}",
                            com.atlassian.annotations.security*,
                            com.atlassian.applinks.api*,
                            com.atlassian.applinks.spi*,
                            com.atlassian.config.lifecycle.events,
                            com.atlassian.core.util,
                            com.atlassian.core.task.*,
                            com.atlassian.event.api,
                            com.atlassian.mywork.event.*,
                            com.atlassian.mywork.model,
                            com.atlassian.mywork.service,
                            com.atlassian.mywork.util,
                            com.atlassian.mywork.rest,
                            com.atlassian.plugin.elements,
                            com.atlassian.plugin.servlet,
                            com.atlassian.plugin.web,
                            com.atlassian.plugin.webresource,
                            com.atlassian.plugin.webresource.transformer,
                            com.atlassian.plugin.webresource.condition,
                            com.atlassian.plugin.webresource.url,
                            com.atlassian.plugins.navlink.consumer.menu.services,
                            com.atlassian.plugins.rest.common.security,
                            com.atlassian.plugin.util.collect.*,
                            com.atlassian.user.impl.*,
                            com.atlassian.confluence.cluster,
                            com.atlassian.confluence.content,
                            com.atlassian.confluence.event.events.*,
                            com.atlassian.confluence.plugin.descriptor.web.urlreadingconditions,
                            com.atlassian.confluence.plugin.descriptor.web.*,
                            com.atlassian.confluence.plugins.mobile.velocity,
                            com.atlassian.confluence.security.*,
                            com.atlassian.confluence.util.velocity,
                            com.atlassian.confluence.mail.*,
                            com.atlassian.confluence.content.render.xhtml,
                            com.atlassian.oauth.event,
                            com.atlassian.sal.*,
                            com.atlassian.seraph.*,
                            com.atlassian.spring.*,
                            com.atlassian.templaterenderer*,
                            com.atlassian.vcache*,
                            com.google.common.*,
                            javax.servlet,
                            javax.servlet.http,
                            javax.ws.rs,
                            javax.ws.rs.core,
                            javax.ws.rs.ext,
                            javax.xml.parsers,
                            net.java.ao;version="${ao.compatibility.version}",
                            net.java.ao.schema;version="${ao.compatibility.version}",
                            org.apache.batik.css.*,
                            org.apache.commons.httpclient,
                            org.apache.commons.httpclient.methods,
                            org.apache.commons.io;version="[1.4,3.0)",
                            org.apache.commons.lang,
                            org.apache.commons.lang.builder,
                            org.apache.commons.lang.time,
                            org.apache.commons.logging,
                            org.apache.xml.serialize,
                            org.codehaus.jackson,
                            org.codehaus.jackson.annotate,
                            org.codehaus.jackson.map,
                            org.codehaus.jackson.node,
                            org.cyberneko.html*,
                            org.dom4j,
                            org.dom4j.io,
                            org.osgi.framework,
                            org.slf4j,
                            org.springframework*,
                            org.w3c.css.sac,
                            org.w3c.dom,
                            org.w3c.dom.ls,
                            org.w3c.dom.traversal,
                            org.xml.sax,
                            org.xml.sax.ext
                        </Import-Package>
                    </instructions>
                    <products>
                        <product>
                            <id>jira</id>
                            <containerId>${tomcat.containerId}</containerId>
                            <instanceId>jira1</instanceId>
                            <version>${jira.version}</version>
                            <dataVersion>${jira.version}</dataVersion>
                            <httpPort>${jira.http.port}</httpPort>
                            <jvmArgs>${jira.jvm.args}</jvmArgs>
                            <pluginArtifacts>
                                <pluginArtifact>
                                    <groupId>com.atlassian.mywork</groupId>
                                    <artifactId>mywork-common-plugin</artifactId>
                                    <version>${project.version}</version>
                                </pluginArtifact>
                                <pluginArtifact>
                                    <groupId>com.atlassian.mywork</groupId>
                                    <artifactId>mywork-jira-provider-plugin</artifactId>
                                    <version>${project.version}</version>
                                </pluginArtifact>
                                <pluginArtifact>
                                    <groupId>com.atlassian.plugins</groupId>
                                    <artifactId>atlassian-plugins-webresource-plugin</artifactId>
                                    <version>${atlassian-plugins-webresource.version}</version>
                                </pluginArtifact>
                            </pluginArtifacts>
                        </product>
                        <product>
                            <id>confluence</id>
                            <containerId>${tomcat.containerId}</containerId>
                            <instanceId>confluence1</instanceId>
                            <version>${confluence.version}</version>
                            <dataVersion>${confluence.data.version}</dataVersion>
                            <jvmArgs>-Datlassian.disable.caches=true</jvmArgs>
                          <pluginArtifacts>
                            <pluginArtifact>
                              <groupId>com.atlassian.confluence.plugins</groupId>
                              <artifactId>share-page</artifactId>
                              <version>${share-page.version}</version>
                            </pluginArtifact>
                            <pluginArtifact>
                              <groupId>com.atlassian.mywork</groupId>
                              <artifactId>mywork-common-plugin</artifactId>
                              <version>${project.version}</version>
                            </pluginArtifact>
                            <pluginArtifact>
                              <groupId>com.atlassian.mywork</groupId>
                              <artifactId>mywork-confluence-provider-plugin</artifactId>
                              <version>${project.version}</version>
                            </pluginArtifact>
                            <pluginArtifact>
                                <groupId>com.atlassian.plugins</groupId>
                                <artifactId>atlassian-plugins-webresource-plugin</artifactId>
                                <version>${atlassian-plugins-webresource.version}</version>
                            </pluginArtifact>
                          </pluginArtifacts>
                        </product>
                    </products>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.github.searls</groupId>
                <artifactId>jasmine-maven-plugin</artifactId>
                <version>1.1.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>test</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <jsSrcDir>${project.basedir}/src/main/resources/js</jsSrcDir>
                    <jsTestSrcDir>${project.basedir}/src/test/js</jsTestSrcDir>
                    <sourceIncludes>
                        <!-- Explicitly include files for order-->
                        <include>lib/underscore-min.js</include>
                        <include>lib/backbone-min.js</include>

                        <include>views/notification-main-view.js</include>
                        <include>views/notification-entry-view.js</include>
                        <include>views/drilldown-view.js</include>
                        <include>views/header-view.js</include>
                        <include>views/action-view.js</include>
                        <include>views/notification-view.js</include>
                        <include>views/miniview/notification-views.js</include>

                        <include>views/task-main-view.js</include>
                        <include>views/taskdetail-view.js</include>
                        <include>views/header-view.js</include>
                        <include>views/task-view.js</include>
                        <include>views/miniview/deprecated-tasks-view.js</include>
                        <include>**/*.js</include>
                    </sourceIncludes>
                    <specIncludes>
                        <include>jasmine-jquery-1.3.1.js</include>
                        <include>**/*.js</include>
                    </specIncludes>
                    <specExcludes>
                        <exclude>helper.js</exclude>
                    </specExcludes>
                    <sourceExcludes>
                        <exclude>mywork.js</exclude>
                        <exclude>mobile/mobile-routes.js</exclude>
                        <exclude>mobile/mobile-mywork.js</exclude>
                        <exclude>views/mobile/notification-views.js</exclude>
                        <exclude>views/mobile/task-views.js</exclude>
                        <exclude>util/mobile-util.js</exclude>
                        <exclude>miniview-anchor.js</exclude>
                        <exclude>lib/jquery.js</exclude>
                        <exclude>lib/jquery.effects.core.js</exclude>
                        <exclude>lib/zepto.min.js</exclude>
                    </sourceExcludes>
                    <preloadSources>
                        <source>${project.basedir}/src/main/resources/js/lib/jquery.js</source>
                        <source>${project.basedir}/src/test/js/sinon-1.3.1.js</source>
                        <source>${project.basedir}/src/test/js/helper.js</source>
                    </preloadSources>
                </configuration>
            </plugin>
            <plugin>
                <groupId>ro.isdc.wro4j</groupId>
                <artifactId>wro4j-maven-plugin</artifactId>
                <version>1.4.4</version>
                <executions>
                    <execution>
                        <phase>test</phase>
                        <goals>
                            <goal>jshint</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <minimize>false</minimize>
                    <options>expr,devel,evil,noarg,trailing</options>
                    <contextFolder>${basedir}/src/main/resources/</contextFolder>
                    <wroFile>${basedir}/src/main/resources/wro.xml</wroFile>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.carrot2.labs</groupId>
                <artifactId>smartsprites-maven-plugin</artifactId>
                <version>1.0</version>
                <configuration>
                    <rootDirPath>${project.basedir}/src/main/resources</rootDirPath>
                    <outputDirPath>${project.build.directory}/classes</outputDirPath>
                </configuration>
                <executions>
                    <execution>
                        <id>spritify</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>spritify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>skipTests</id>
            <properties>
                <skipTests>true</skipTests>
            </properties>
        </profile>
        <profile>
            <id>create-rest-apidocs</id>
            <activation>
                <activeByDefault>false</activeByDefault>
                <property>
                    <name>nat.generateDocs</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-resources-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>copy-doc-resources</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>copy-resources</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${restdoc.directory}</outputDirectory>
                                    <resources>
                                        <resource>
                                            <directory>${doc.directory}</directory>
                                            <filtering>true</filtering>
                                        </resource>
                                    </resources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>create-api-zip</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>single</goal>
                                </goals>
                                <configuration>
                                    <descriptors>
                                        <descriptor>${doc.directory}/api.xml</descriptor>
                                    </descriptors>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <properties>
        <instanceId>confluence1</instanceId>
        <jira.http.port>2990</jira.http.port>
        <jira.jvm.args />
        <doc.directory>${basedir}/src/main/doc</doc.directory>
        <restdoc.directory>${project.build.directory}/restapi</restdoc.directory>
        <root.dir>..</root.dir>
    </properties>

</project>
