<?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>org.mule.extensions</groupId>
        <artifactId>mule-core-modules-parent</artifactId>
        <version>1.1.2</version>
    </parent>

    <groupId>org.mule.modules</groupId>
    <artifactId>mule-scripting-module</artifactId>
    <packaging>mule-extension</packaging>
    <version>1.1.4</version>

    <name>Scripting Module</name>
    <description>Support for embedding scripts inside Mule artifacts</description>

    <properties>
        <formatterConfigPath>formatter.xml</formatterConfigPath>

        <jython.version>2.7.1</jython.version>
        <groovyVersion>2.4.15</groovyVersion>
        <jrubyVersion>9.1.16.0</jrubyVersion>

        <projectReactorVersion>3.2.0.M1</projectReactorVersion>

        <!-- Remove when a new parent version with MTF is available -->
        <munit.input.directory>src/test/munit</munit.input.directory>
        <munit.output.directory>${basedir}/target/test-mule/munit</munit.output.directory>
        <munit.extensions.maven.plugin.version>1.0.0-BETA</munit.extensions.maven.plugin.version>
        <munit.version>2.2.0-BETA</munit.version>
        <mavenResources.version>3.0.2</mavenResources.version>
    </properties>

    <dependencies>
        <!-- Reactor -->
        <dependency>
            <groupId>io.projectreactor</groupId>
            <artifactId>reactor-core</artifactId>
            <version>${projectReactorVersion}</version>
        </dependency>

        <!--Groovy-->
        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-all</artifactId>
            <version>${groovyVersion}</version>
            <classifier>indy</classifier>
        </dependency>

        <!--Jython-->
        <dependency>
            <groupId>org.python</groupId>
            <artifactId>jython-standalone</artifactId>
            <version>${jython.version}</version>
        </dependency>

        <!--Ruby-->
        <dependency>
            <groupId>org.jruby</groupId>
            <artifactId>jruby-core</artifactId>
            <version>${jrubyVersion}</version>
        </dependency>
        <dependency>
            <groupId>org.jruby</groupId>
            <artifactId>jruby-stdlib</artifactId>
            <version>${jrubyVersion}</version>
        </dependency>

        <!-- Test dependencies -->
        <dependency>
            <groupId>org.mule.tests.plugin</groupId>
            <artifactId>mule-tests-component-plugin</artifactId>
            <version>${mule.version}</version>
            <classifier>mule-plugin</classifier>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mule.tests</groupId>
            <artifactId>mule-tests-model</artifactId>
            <version>${mule.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.mule.runtime.plugins</groupId>
                <artifactId>mule-plugin-maven-plugin</artifactId>
                <extensions>true</extensions>
                <version>${mule.app.plugins.maven.plugin.version}</version>
            </plugin>
                <plugin>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>${mavenResources.version}</version>
                    <executions>
                        <execution>
                            <id>copy-munit-resources</id>
                            <phase>process-test-resources</phase>
                            <goals>
                                <goal>copy-resources</goal>
                            </goals>
                            <configuration>
                                <outputDirectory>${munit.output.directory}</outputDirectory>
                                <resources>
                                    <resource>
                                        <directory>${munit.input.directory}</directory>
                                        <filtering>true</filtering>
                                    </resource>
                                </resources>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>com.mulesoft.munit</groupId>
                    <artifactId>munit-extensions-maven-plugin</artifactId>
                    <version>${munit.extensions.maven.plugin.version}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>test</goal>
                            </goals>
                            <phase>integration-test</phase>
                        </execution>
                    </executions>
                    <configuration>
                        <runtimeConfiguration>
                            <discoverRuntimes>
                                <product>ALL</product>
                                <includeSnapshots>true</includeSnapshots>
                            </discoverRuntimes>
                        </runtimeConfiguration>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>com.mulesoft.munit</groupId>
                            <artifactId>munit-runner</artifactId>
                            <version>${munit.version}</version>
                            <classifier>mule-plugin</classifier>
                        </dependency>
                        <dependency>
                            <groupId>com.mulesoft.munit</groupId>
                            <artifactId>munit-tools</artifactId>
                            <version>${munit.version}</version>
                            <classifier>mule-plugin</classifier>
                        </dependency>
                    </dependencies>
                </plugin>
        </plugins>
    </build>
</project>
