<?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>

    <groupId>org.mule.tools.javascript</groupId>
    <artifactId>brunch-maven-plugin</artifactId>
    <version>1.0</version>
    <packaging>maven-plugin</packaging>

    <name>Brunch Maven Plugin</name>
    <description>Build projects using branch from Maven.</description>

    <scm>
        <connection>scm:git:git://github.com:mulesoft/brunch-rhinodo.git</connection>
        <developerConnection>scm:git:git@github.com:mulesoft/brunch-rhinodo.git</developerConnection>
        <url>http://github.com/mulesoft/brunch-rhinodo</url>
    </scm>

    <prerequisites>
        <maven>3.0.3</maven>
    </prerequisites>

    <properties>
        <license.plugin.version>1.8.0</license.plugin.version>
        <maven.version>3.0.3</maven.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.mule.tools.javascript</groupId>
                <artifactId>npm-maven-plugin</artifactId>
                <version>1.1-SNAPSHOT</version>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>fetch-modules</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${basedir}/src/main/resources/META-INF/node_modules</outputDirectory>
                            <packages>
                                <package>brunch:1.4.4</package>
                                <!--<package>less:1.3.0</package>-->
                                <!--<package>chai:1.2.0</package>-->
                            </packages>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.mycila.maven-license-plugin</groupId>
                <artifactId>maven-license-plugin</artifactId>
                <version>${license.plugin.version}</version>
                <configuration>
                    <header>LICENSE_HEADER.txt</header>
                    <excludes>
                        <exclude>LICENSE.md</exclude>
                        <exclude>target/**</exclude>
                        <exclude>.gitignore</exclude>
                        <exclude>**/*.txt</exclude>
                        <exclude>**/*.xsd</exclude>
                        <exclude>**/*.properties</exclude>
                        <exclude>**/*.xml</exclude>
                        <exclude>**/*.coffee</exclude>
                        <exclude>**/*.css</exclude>
                        <exclude>**/*.groovy</exclude>
                        <exclude>**/*.js</exclude>
                        <exclude>**/*.html</exclude>
                        <exclude>src/main/resources/META-INF/**</exclude>
                        <exclude>**/package.json</exclude>
                        <exclude>.idea/**</exclude>
                        <exclude>src/it/basic/brunch/**</exclude>
                        <exclude>.checkstyle</exclude>
                        <exclude>README.md</exclude>
                    </excludes>
                    <mapping>
                        <grf>XML_STYLE</grf>
                    </mapping>
                    <strictCheck>true</strictCheck>
                </configuration>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- Integration Tests -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-invoker-plugin</artifactId>
                <version>1.5</version>
                <configuration>
                    <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
                    <debug>true</debug>
                    <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
                    <postBuildHookScript>verify</postBuildHookScript>
                    <projectsDirectory>src/it</projectsDirectory>
                    <settingsFile>src/it/settings.xml</settingsFile>
                </configuration>
                <executions>
                    <execution>
                        <id>integration-test</id>
                        <goals>
                            <goal>install</goal>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <distributionManagement>
        <repository>
            <id>mulesoft-releases</id>
            <name>MuleSoft Repository</name>
            <url>https://repository.mulesoft.org/releases/</url>
        </repository>
        <snapshotRepository>
            <id>mulesoft-snapshots</id>
            <name>MuleSoft Snapshot Repository</name>
            <url>https://repository.mulesoft.org/snapshots/</url>
            <uniqueVersion>false</uniqueVersion>
        </snapshotRepository>
    </distributionManagement>

    <dependencies>
        <dependency>
            <artifactId>rhinodo</artifactId>
            <groupId>org.mule.tools.javascript</groupId>
            <version>2.0-SNAPSHOT</version>
        </dependency>

        <!-- Test -->
        <dependency>
            <artifactId>junit</artifactId>
            <groupId>junit</groupId>
            <version>4.10</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>1.9.0</version>
            <scope>test</scope>
        </dependency>

        <!-- Maven -->
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-core</artifactId>
            <version>${maven.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>${maven.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-io</artifactId>
            <version>1.3.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.shared</groupId>
            <artifactId>maven-verifier</artifactId>
            <version>1.3</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.plugin-testing</groupId>
            <artifactId>maven-plugin-testing-harness</artifactId>
            <version>1.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.sonatype.plexus</groupId>
            <artifactId>plexus-build-api</artifactId>
            <version>0.0.7</version>
        </dependency>
    </dependencies>

</project>
