<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>
  <parent>
    <groupId>org.mule.modules</groupId>
    <artifactId>mule-spring-module-parent</artifactId>
    <version>1.3.11</version>
  </parent>
  <artifactId>mule-spring-module</artifactId>
  <packaging>mule-extension</packaging>

  <properties>
    <formatterConfigPath>../formatter.xml</formatterConfigPath>
    <minMuleVersion>${mule.version}</minMuleVersion>

    <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.2.0-rc2</munit.extensions.maven.plugin.version>
    <munit.version>3.1.0-rc3</munit.version>
    <mtf.tools.version>1.2.0-rc1</mtf.tools.version>

    <mavenResourcesVersion>3.0.2</mavenResourcesVersion>

    <jacoco.version>0.8.10</jacoco.version>
    <sdk.api.version>0.7.0</sdk.api.version>
    <http.connector.version>1.8.1</http.connector.version>
    <mule.java.module.version>1.2.12</mule.java.module.version>
    <mule.sockets.connector.version>1.2.3</mule.sockets.connector.version>
  </properties>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <id>baseJar</id>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <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>
        <groupId>com.google.code.maven-replacer-plugin</groupId>
        <artifactId>replacer</artifactId>
        <version>1.5.3</version>
        <executions>
          <execution>
            <phase>compile</phase>
            <goals>
              <goal>replace</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <file>${project.build.directory}/classes/META-INF/mule-artifact/mule-artifact.json</file>
          <replacements>
            <replacement>
              <token>%MIN_MULE_VERSION%</token>
              <value>${minMuleVersion}</value>
            </replacement>
          </replacements>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.mulesoft.munit</groupId>
        <artifactId>munit-extensions-maven-plugin</artifactId>
        <version>${munit.extensions.maven.plugin.version}</version>
        <executions>
          <execution>
            <id>test</id>
            <phase>integration-test</phase>
            <goals>
              <goal>test</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <!-- Configure the Spring dependencies as Shared Libraries -->
          <sharedLibraries>
            <sharedLibrary>
              <groupId>org.springframework.security</groupId>
              <artifactId>spring-security-core</artifactId>
            </sharedLibrary>
            <sharedLibrary>
              <groupId>org.springframework</groupId>
              <artifactId>spring-beans</artifactId>
            </sharedLibrary>
            <sharedLibrary>
              <groupId>org.springframework</groupId>
              <artifactId>spring-context</artifactId>
            </sharedLibrary>
            <sharedLibrary>
              <groupId>org.springframework</groupId>
              <artifactId>spring-core</artifactId>
            </sharedLibrary>
            <sharedLibrary>
              <groupId>org.springframework.security</groupId>
              <artifactId>spring-security-config</artifactId>
            </sharedLibrary>
            <sharedLibrary>
              <groupId>org.springframework.security</groupId>
              <artifactId>spring-security-crypto</artifactId>
            </sharedLibrary>
            <sharedLibrary>
              <groupId>org.springframework.security</groupId>
              <artifactId>spring-security-web</artifactId>
            </sharedLibrary>
            <sharedLibrary>
              <groupId>org.springframework</groupId>
              <artifactId>spring-expression</artifactId>
            </sharedLibrary>
            <sharedLibrary>
              <groupId>org.springframework</groupId>
              <artifactId>spring-jcl</artifactId>
            </sharedLibrary>
            <sharedLibrary>
              <groupId>org.springframework</groupId>
              <artifactId>spring-aop</artifactId>
            </sharedLibrary>
            <sharedLibrary>
              <groupId>org.mule.tests</groupId>
              <artifactId>mule-tests-model</artifactId>
            </sharedLibrary>
          </sharedLibraries>
          <argLines>
            <argLine>
              -javaagent:${settings.localRepository}/org/jacoco/org.jacoco.agent/${jacoco.version}/org.jacoco.agent-${jacoco.version}-runtime.jar=destfile=${session.executionRootDirectory}/target/jacoco-munit.exec
            </argLine>
          </argLines>
          <runtimeConfiguration>
            <discoverRuntimes>
              <minMuleVersion>${minVersion}</minMuleVersion>
              <includeSnapshots>false</includeSnapshots>
              <product>EE</product>
            </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>
          <dependency>
            <groupId>com.mulesoft.munit</groupId>
            <artifactId>mtf-tools</artifactId>
            <version>${mtf.tools.version}</version>
            <classifier>mule-plugin</classifier>
          </dependency>
        </dependencies>
      </plugin>
    </plugins>
  </build>


  <dependencies>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context</artifactId>
      <version>${springVersion}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-beans</artifactId>
      <version>${springVersion}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-core</artifactId>
      <version>${springVersion}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework.security</groupId>
      <artifactId>spring-security-core</artifactId>
      <version>${springSecurityVersion}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework.security</groupId>
      <artifactId>spring-security-crypto</artifactId>
      <version>${springSecurityVersion}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework.security</groupId>
      <artifactId>spring-security-config</artifactId>
      <version>${springSecurityVersion}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework.security</groupId>
      <artifactId>spring-security-web</artifactId>
      <version>${springSecurityVersion}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework.security</groupId>
      <artifactId>spring-security-ldap</artifactId>
      <version>${springSecurityVersion}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-expression</artifactId>
      <version>${springVersion}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-jcl</artifactId>
      <version>${springVersion}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-aop</artifactId>
      <version>${springVersion}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.mule.module</groupId>
      <artifactId>mule-java-module</artifactId>
      <version>${mule.java.module.version}</version>
      <classifier>mule-plugin</classifier>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mule.connectors</groupId>
      <artifactId>mule-http-connector</artifactId>
      <version>${http.connector.version}</version>
      <classifier>mule-plugin</classifier>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mule.connectors</groupId>
      <artifactId>mule-sockets-connector</artifactId>
      <version>${mule.sockets.connector.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>
    <dependency>
      <groupId>org.mule.sdk</groupId>
      <artifactId>mule-sdk-api</artifactId>
      <version>${sdk.api.version}</version>
    </dependency>
  </dependencies>
</project>
