<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">
    <parent>
        <groupId>com.mulesoft.connectors</groupId>
        <artifactId>mule-connectivity-parent</artifactId>
        <version>1.4.0</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>mule-redis-connector</artifactId>
    <version>5.4.2</version>
    <packaging>mule-extension</packaging>
    <name>Redis Connector - Mule 4</name>

    <properties>
        <licensePath>LICENSE.md</licensePath>
        <devkit.studio.package.skip>false</devkit.studio.package.skip>
        <project.structure.validation.version>1.0.6</project.structure.validation.version>
        <idea.annotations.version>12.0</idea.annotations.version>
        <harmcrest.version>1.3</harmcrest.version>
        <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</munit.extensions.maven.plugin.version>
        <munit.version>2.2.4</munit.version>
        <mavenResourcesVersion>3.3.0</mavenResourcesVersion>
        <!-- runtime version to run -->
        <runtimeVersion>4.1.5</runtimeVersion>
        <runtimeProduct>MULE_EE</runtimeProduct>
        <jacoco.maven.plugin.version>0.8.10</jacoco.maven.plugin.version>
        <sonar.coverage.exclusions>**org/mule/extension/redis/internal/utils/RedisConstants.java,**org/mule/extension/redis/api/SubscribeChannelAttributes.java,**org/mule/extension/redis/internal/RedisExtension.java</sonar.coverage.exclusions>
        <jedis.version>3.10.0</jedis.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.mule.connectors</groupId>
            <artifactId>mule-objectstore-connector</artifactId>
            <version>1.2.1</version>
            <scope>test</scope>
            <classifier>mule-plugin</classifier>
        </dependency>

        <dependency>
            <groupId>redis.clients</groupId>
            <artifactId>jedis</artifactId>
            <version>${jedis.version}</version>
            <type>jar</type>
        </dependency>

        <!-- Testing Dependencies -->

        <dependency>
            <groupId>com.github.kstyrc</groupId>
            <artifactId>embedded-redis</artifactId>
            <version>0.6</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-core</artifactId>
            <version>${harmcrest.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-library</artifactId>
            <version>${harmcrest.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mule.modules</groupId>
            <artifactId>mule-scripting-module</artifactId>
            <version>1.1.7</version>
            <classifier>mule-plugin</classifier>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-install-plugin</artifactId>
                <version>2.5.2</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>2.8.2</version>
            </plugin>
            <plugin>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.4</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>none</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-install-plugin</artifactId>
                <version>2.5.2</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>2.8.2</version>
            </plugin>

            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>${mavenResourcesVersion}</version>
                <executions>
                    <execution>
                        <id>copy-munit-resources</id>
                        <phase>process-test-resources</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${basedir}/target/test-mule/munit</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>src/test/munit</directory>
                                    <filtering>true</filtering>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.mulesoft.munit</groupId>
                <artifactId>munit-extensions-maven-plugin</artifactId>
                <version>1.1.3</version>
                <executions>
                    <execution>
                        <phase>integration-test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <!-- MUnit 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>
                <configuration>
                    <argLines>
                        <argLine>-javaagent:${settings.localRepository}/org/jacoco/org.jacoco.agent/${jacoco.maven.plugin.version}/org.jacoco.agent-${jacoco.maven.plugin.version}-runtime.jar=destfile=${session.executionRootDirectory}/target/jacoco-munit.exec</argLine>
                    </argLines>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco.maven.plugin.version}</version>
                <configuration>
                    <destFile>${session.executionRootDirectory}/target/jacoco-java.exec</destFile>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>merge</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>merge</goal>
                        </goals>
                        <configuration>
                            <destFile>${session.executionRootDirectory}/target/jacoco.exec</destFile>
                            <fileSets>
                                <fileSet>
                                    <directory>${project.build.directory}</directory>
                                    <includes>
                                        <include>*.exec</include>
                                    </includes>
                                </fileSet>
                            </fileSets>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <scm>
        <connection>scm:git:git://github.com/mulesoft/mule4-redis-connector.git</connection>
        <developerConnection>scm:git:git@github.com:mulesoft/mule4-redis-connector.git</developerConnection>
        <url>https://github.com/mulesoft/mule4-redis-connector</url>
        <tag>HEAD</tag>
    </scm>
    <repositories>
        <repository>
            <id>mule-releases</id>
            <name>Nexus Public Releases</name>
            <url>https://repository-master.mulesoft.org/nexus/content/repositories/releases/</url>
        </repository>
    </repositories>
</project>
