<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.5.2</version>
    </parent>
    <artifactId>mule-spring-module</artifactId>
    <packaging>mule-extension</packaging>

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

    <http.connector.version>1.12.1</http.connector.version>
    <mule.java.module.version>1.2.17</mule.java.module.version>
    <mule.sockets.connector.version>1.2.9</mule.sockets.connector.version>

    <!-- Allure test-reporting annotations; formerly provided by mule-core-modules-parent. Pinned to
         the last Java 8 compatible release since surefire runs on Java 8 under the parent's profile. -->
    <allure.version>2.24.0</allure.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>
      <!-- The Spring artifacts below are declared as provided-scope shared libraries (see the
           sharedLibraries block) so the runtime provisions them; allure-junit4 is a test-runtime
           JUnit listener. None are referenced by direct imports, so the parent's analyze-only would
           flag them as unused-declared. Whitelist them rather than dropping needed dependencies. -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>connector-analyze</id>
            <configuration>
              <ignoredUnusedDeclaredDependencies>
                <ignoredUnusedDeclaredDependency>org.springframework.security:spring-security-config</ignoredUnusedDeclaredDependency>
                <ignoredUnusedDeclaredDependency>org.springframework.security:spring-security-web</ignoredUnusedDeclaredDependency>
                <ignoredUnusedDeclaredDependency>org.springframework.security:spring-security-ldap</ignoredUnusedDeclaredDependency>
                <ignoredUnusedDeclaredDependency>org.springframework:spring-expression</ignoredUnusedDeclaredDependency>
                <ignoredUnusedDeclaredDependency>org.springframework:spring-aop</ignoredUnusedDeclaredDependency>
                <ignoredUnusedDeclaredDependency>io.qameta.allure:allure-junit4</ignoredUnusedDeclaredDependency>
              </ignoredUnusedDeclaredDependencies>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.mulesoft.munit</groupId>
        <artifactId>munit-extensions-maven-plugin</artifactId>
        <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>
          <runtimeConfiguration>
            <discoverRuntimes>
              <minMuleVersion>${minVersion}</minMuleVersion>
              <includeSnapshots>false</includeSnapshots>
              <product>EE</product>
            </discoverRuntimes>
          </runtimeConfiguration>
        </configuration>
      </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>io.qameta.allure</groupId>
      <artifactId>allure-junit4</artifactId>
      <version>${allure.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>
