<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         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>com.github.fridujo</groupId>
    <artifactId>rabbitmq-mock</artifactId>
    <version>1.2.0</version>

    <name>RabbitMQ-Mock</name>
    <description>Mock for RabbitMQ Java amqp-client</description>
    <url>https://github.com/fridujo/rabbitmq-mock</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>

        <rabbitmq.client.version>5.16.0</rabbitmq.client.version>

        <assertj.version>3.23.1</assertj.version>
        <mockito.version>4.8.0</mockito.version>
        <micrometer.version>1.9.5</micrometer.version>
        <spring.amqp.version>2.4.7</spring.amqp.version>
        <logback.version>1.4.4</logback.version>

        <skipTests>false</skipTests>
        <junit.jupiter.version>5.9.1</junit.jupiter.version>
        <awaitility.version>4.2.0</awaitility.version>
        <pitest-junit5.version>1.1.0</pitest-junit5.version>

        <maven-javadoc-plugin.version>3.4.1</maven-javadoc-plugin.version>
        <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
        <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
        <maven-invoker-plugin.version>3.3.0</maven-invoker-plugin.version>
        <maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
        <nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>
        <jacoco-maven-plugin.version>0.8.8</jacoco-maven-plugin.version>
        <pitest-maven-plugin.version>1.9.8</pitest-maven-plugin.version>
    </properties>

    <scm>
        <url>https://github.com/fridujo/rabbitmq-mock.git</url>
        <connection>scm:git:ssh://git@github.com/fridujo/rabbitmq-mock.git</connection>
        <developerConnection>scm:git:ssh://git@github.com/fridujo/rabbitmq-mock.git</developerConnection>
        <tag>HEAD</tag>
    </scm>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>ledoyen</id>
            <name>Loïc Ledoyen</name>
            <url>https://github.com/ledoyen</url>
            <email>ledoyen.loic@gmail.com</email>
        </developer>
    </developers>

    <dependencies>
        <dependency>
            <groupId>com.rabbitmq</groupId>
            <artifactId>amqp-client</artifactId>
            <version>${rabbitmq.client.version}</version>
            <scope>provided</scope>
        </dependency>

        <!-- Test dependencies -->
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>${assertj.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${mockito.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.micrometer</groupId>
            <artifactId>micrometer-core</artifactId>
            <version>${micrometer.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.amqp</groupId>
            <artifactId>spring-rabbit</artifactId>
            <version>${spring.amqp.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>${logback.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>${junit.jupiter.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.awaitility</groupId>
            <artifactId>awaitility</artifactId>
            <version>${awaitility.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven-javadoc-plugin.version}</version>
                <configuration>
                    <quiet>true</quiet>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${maven-source-plugin.version}</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <artifactId>maven-invoker-plugin</artifactId>
                <version>${maven-invoker-plugin.version}</version>
                <configuration>
                    <projectsDirectory>src/it</projectsDirectory>
                    <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
                    <pomIncludes>
                        <pomInclude>*/pom.xml</pomInclude>
                    </pomIncludes>
                    <filterProperties>
                        <rabbitmq-mock.version>${project.version}</rabbitmq-mock.version>
                    </filterProperties>
                    <skipInvocation>${skipTests}</skipInvocation>
                </configuration>
                <executions>
                    <execution>
                        <id>install-dependencies</id>
                        <goals>
                            <goal>install</goal>
                        </goals>
                        <phase>integration-test</phase>
                    </execution>
                    <execution>
                        <id>spring-boot-1.4.0</id>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <phase>integration-test</phase>
                        <configuration>
                            <filterProperties>
                                <spring-boot.version>1.4.0.RELEASE</spring-boot.version>
                            </filterProperties>
                            <pomIncludes>
                                <pomInclude>spring_boot/pom.xml</pomInclude>
                            </pomIncludes>
                        </configuration>
                    </execution>
                    <execution>
                        <id>spring-boot-1.5.0</id>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <phase>integration-test</phase>
                        <configuration>
                            <filterProperties>
                                <spring-boot.version>1.5.0.RELEASE</spring-boot.version>
                            </filterProperties>
                            <pomIncludes>
                                <pomInclude>spring_boot/pom.xml</pomInclude>
                            </pomIncludes>
                        </configuration>
                    </execution>
                    <execution>
                        <id>spring-boot-1.5.12</id>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <phase>integration-test</phase>
                        <configuration>
                            <filterProperties>
                                <spring-boot.version>1.5.12.RELEASE</spring-boot.version>
                            </filterProperties>
                            <pomIncludes>
                                <pomInclude>spring_boot/pom.xml</pomInclude>
                            </pomIncludes>
                        </configuration>
                    </execution>
                    <execution>
                        <id>spring-boot-2.0.0</id>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <phase>integration-test</phase>
                        <configuration>
                            <filterProperties>
                                <spring-boot.version>2.0.0.RELEASE</spring-boot.version>
                            </filterProperties>
                            <pomIncludes>
                                <pomInclude>spring_boot/pom.xml</pomInclude>
                            </pomIncludes>
                        </configuration>
                    </execution>
                    <execution>
                        <id>spring-boot-2.1.0</id>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <phase>integration-test</phase>
                        <configuration>
                            <filterProperties>
                                <spring-boot.version>2.1.0.RELEASE</spring-boot.version>
                            </filterProperties>
                            <pomIncludes>
                                <pomInclude>spring_boot/pom.xml</pomInclude>
                            </pomIncludes>
                        </configuration>
                    </execution>
                    <execution>
                        <id>spring-boot-2.2.8</id>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <phase>integration-test</phase>
                        <configuration>
                            <filterProperties>
                                <spring-boot.version>2.2.8.RELEASE</spring-boot.version>
                            </filterProperties>
                            <pomIncludes>
                                <pomInclude>spring_boot/pom.xml</pomInclude>
                            </pomIncludes>
                        </configuration>
                    </execution>
                    <execution>
                        <id>spring-boot-2.3.1</id>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <phase>integration-test</phase>
                        <configuration>
                            <filterProperties>
                                <spring-boot.version>2.3.1.RELEASE</spring-boot.version>
                            </filterProperties>
                            <pomIncludes>
                                <pomInclude>spring_boot/pom.xml</pomInclude>
                            </pomIncludes>
                        </configuration>
                    </execution>
                    <execution>
                        <id>spring-cloud-bus-Finchley</id>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <phase>integration-test</phase>
                        <configuration>
                            <pomIncludes>
                                <pomInclude>spring_cloud_bus/pom.xml</pomInclude>
                            </pomIncludes>
                        </configuration>
                    </execution>
                    <execution>
                        <id>Alpakka</id>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <phase>integration-test</phase>
                        <configuration>
                            <pomIncludes>
                                <pomInclude>alpakka/pom.xml</pomInclude>
                            </pomIncludes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.pitest</groupId>
                <artifactId>pitest-maven</artifactId>
                <version>${pitest-maven-plugin.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>org.pitest</groupId>
                        <artifactId>pitest-junit5-plugin</artifactId>
                        <version>${pitest-junit5.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
        </repository>
    </distributionManagement>

    <profiles>
        <profile>
            <id>ossrh</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven-gpg-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>${nexus-staging-maven-plugin.version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
