<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.soy</groupId>
        <artifactId>soy-templates-parent</artifactId>
        <version>2.1.1</version>
    </parent>

    <groupId>com.atlassian.soy</groupId>
    <artifactId>soy-template-plugin</artifactId>

    <name>Atlassian Soy Templates - Plugin</name>

    <packaging>atlassian-plugin</packaging>

    <build>
        <plugins>
            <!-- SOY-1 Moving the soy util javascript into our folders so we can minify it-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>unpack</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>com.google.template.soy</groupId>
                                    <artifactId>soycompiler</artifactId>
                                    <version>${soy.version}</version>
                                    <type>jar</type>
                                    <outputDirectory>${project.basedir}/src/main/resources/</outputDirectory>
                                    <includes>**/soyutils.js</includes>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.6</version>
                <executions>
                    <execution>
                        <phase>generate-resources</phase>
                        <configuration>
                            <target>
                                <echo>
                                    Replacing first occurrence of /* with /*! in soyutils.js so we don't minify the
                                    license
                                </echo>
                                <replaceregexp file="${project.basedir}/src/main/resources/js/soyutils.js" match="/\*" replace="/*!">
                                </replaceregexp>
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>maven-amps-plugin</artifactId>
                <version>3.6.2</version>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <!-- we need to export enough of Soy for other plugins to be able to write custom functions -->
                        <Export-Package>com.atlassian.soy.renderer,<!-- Needed because it gets wrongly exported -->
                            com.atlassian.soy.impl, <!--TODO TEMPORARY-->
                            org.apache.commons.beanutils;version="${beanutils.version}",
                            com.google.template.soy.shared,
                            com.google.template.soy.shared.restricted,
                            com.google.template.soy.data,
                            com.google.template.soy.data.restricted,
                            com.google.template.soy.tofu,
                            com.google.template.soy.tofu.restricted,
                            com.google.template.soy.jssrc,
                            com.google.template.soy.jssrc.restricted,
                            com.google.template.soy.base,
                            com.google.template.soy.internal.base,
                        </Export-Package>
                        <Import-Package>
                            !com.google.inject.internal.asm.util,
                            javax.inject,
                            org.aopalliance*,
                            com.atlassian.soy.renderer,
                            javax.servlet.http.*,
                            com.atlassian.sal.api*;version="${sal.version}",
                            com.atlassian.plugin.*;version="${plugins.version}",
                            com.atlassian.plugin;version="${plugins.version}",
                            com.atlassian.util.concurrent;version="${atlassian.concurrent.version}",
                            com.google.common.*;version="${guava.osgi.version}",
                            org.slf4j;version="${slf4j.version}",
                            org.apache.commons.beanutils;version="${beanutils.version}",
                            org.apache.commons.lang;version="[2.0,3.0)",
                            org.apache.commons.logging,
                            org.xml.sax;version="0.0.0",
                            org.xml.sax.helpers;version="0.0.0",
                            org.dom4j*;version="0.0.0"
                        </Import-Package>
                    </instructions>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>com.google.template.soy</groupId>
            <artifactId>soycompiler</artifactId>
        </dependency>
        <dependency>
            <groupId>org.sonatype.sisu.inject</groupId>
            <artifactId>guice-multibindings</artifactId>
        </dependency>
        <dependency>
            <groupId>org.sonatype.sisu.inject</groupId>
            <artifactId>guice-assistedinject</artifactId>
        </dependency>
        <dependency>
            <groupId>org.sonatype.sisu</groupId>
            <artifactId>sisu-guice</artifactId>
        </dependency>
        <dependency>
            <groupId>javax.inject</groupId>
            <artifactId>javax.inject</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>aopalliance</groupId>
            <artifactId>aopalliance</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.soy</groupId>
            <artifactId>soy-template-renderer-api</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.sal</groupId>
            <artifactId>sal-api</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.atlassian.plugins</groupId>
            <artifactId>atlassian-plugins-webresource</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>commons-beanutils</groupId>
            <artifactId>commons-beanutils</artifactId>
            <version>${beanutils.version}</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <artifactId>commons-logging</artifactId>
                    <groupId>commons-logging</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.atlassian.util.concurrent</groupId>
            <artifactId>atlassian-util-concurrent</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <scope>provided</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>
    </dependencies>

</project>

