<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>

  <groupId>com.avides.spring</groupId>
  <artifactId>spring-rabbit</artifactId>
  <version>2.7.0</version>

  <name>spring-rabbit</name>
  <description>Makes configuring RabbitMQ for Spring Boot applications more comfortable</description>
  <url>https://github.com/avides/spring-rabbit</url>
  <organization>
    <name>AVIDES Media AG</name>
    <url>https://www.avides.com</url>
  </organization>
  <licenses>
    <license>
      <name>MIT License</name>
      <url>http://www.opensource.org/licenses/mit-license.php</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>Julian Eggers</name>
      <email>eggers.julian@gmail.com</email>
    </developer>
  </developers>

  <scm>
    <url>https://github.com/avides/spring-rabbit</url>
    <connection>scm:git:https://github.com/avides/spring-rabbit.git</connection>
    <developerConnection>scm:git:https://github.com/avides/spring-rabbit.git</developerConnection>
  </scm>

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

  <properties>
    <!-- System -->
    <timestamp>${maven.build.timestamp}</timestamp>
    <maven.build.timestamp.format>dd.MM.yyyy HH:mm</maven.build.timestamp.format>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <java.version>11</java.version>
    <!-- Build -->
    <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
    <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
    <maven-javadoc-plugin.version>3.3.1</maven-javadoc-plugin.version>
    <maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
    <maven-surefire-plugin.version>3.0.0-M4</maven-surefire-plugin.version> <!-- Cannot be upgraded to milestone version 3.0.0-M5 because of many JUNIT errors (missing dependencies) -->
    <maven-failsafe-plugin.version>3.0.0-M4</maven-failsafe-plugin.version> <!-- Cannot be upgraded to milestone version 3.0.0-M5 because of many JUNIT errors (missing dependencies) -->
    <maven-enforcer-plugin.version>3.0.0-M3</maven-enforcer-plugin.version>
    <maven-release-plugin.version>3.0.0-M1</maven-release-plugin.version>
    <maven-scm-provider-gitexe.version>1.11.2</maven-scm-provider-gitexe.version>
    <exists-maven-plugin.version>0.3.0</exists-maven-plugin.version>
    <github-release-plugin.version>1.4.0</github-release-plugin.version>
    <nexus-staging-maven-plugin.version>1.6.12</nexus-staging-maven-plugin.version>
    <!-- Spring -->
    <spring-framework.version>${spring.version}</spring-framework.version>
    <spring.version>5.3.15</spring.version><!-- deprecated: use spring-framework.version instead -->
    <spring-boot.version>2.6.3</spring-boot.version>
    <http-client.version>4.0.0</http-client.version>
    <httpclient.version>4.5.13</httpclient.version>
    <micrometer.version>${micrometer-core.version}</micrometer.version>
    <micrometer-core.version>1.8.2</micrometer-core.version><!-- deprecated: use micrometer.version instead -->
    <!-- Validation -->
    <hibernate-validator.version>6.0.20.Final</hibernate-validator.version>
    <!-- Other -->
    <lombok.version>1.18.22</lombok.version>
    <!-- Testing -->
    <javax-jaxb.version>${jaxb-api.version}</javax-jaxb.version>
    <jaxb-api.version>2.3.1</jaxb-api.version><!-- deprecated: use javax-jaxb.version instead -->
    <jaxb-core.version>2.3.0.1</jaxb-core.version>
    <jaxb-impl.version>2.3.3</jaxb-impl.version>
    <junit.version>4.13.2</junit.version>
    <assertj.version>3.21.0</assertj.version>
    <jacoco.version>0.8.7</jacoco.version>
    <powermock.version>2.0.9</powermock.version>
    <easymock.version>4.3</easymock.version>
    <spring-xom-unmarshaller.version>1.4.0</spring-xom-unmarshaller.version>
    <javax.el.version>3.0.0</javax.el.version>
    <springtainer-rabbitmq.version>1.3.0</springtainer-rabbitmq.version>
    <logback.version>${logback-classic.version}</logback.version>
    <logback-classic.version>1.2.10</logback-classic.version> <!-- deprecated: use logback.version instead -->
    <awaitility.version>4.1.1</awaitility.version>
  </properties>

  <dependencies>
    <!-- Spring -->
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-amqp</artifactId>
      <version>${spring-boot.version}</version>
    </dependency>
    <dependency>
      <groupId>com.rabbitmq</groupId>
      <artifactId>http-client</artifactId>
      <version>${http-client.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpclient</artifactId>
      <version>${httpclient.version}</version>
    </dependency>
    <dependency>
      <groupId>io.micrometer</groupId>
      <artifactId>micrometer-core</artifactId>
      <version>${micrometer.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-configuration-processor</artifactId>
      <version>${spring-boot.version}</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-web</artifactId>
      <version>${spring-framework.version}</version>
    </dependency>

    <!-- Validation -->
    <dependency>
      <groupId>org.hibernate.validator</groupId>
      <artifactId>hibernate-validator</artifactId>
      <version>${hibernate-validator.version}</version>
      <scope>provided</scope>
    </dependency>

    <!-- Other -->
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <version>${lombok.version}</version>
      <scope>provided</scope>
    </dependency>

    <!-- Testing -->
    <dependency>
      <groupId>javax.xml.bind</groupId>
      <artifactId>jaxb-api</artifactId>
      <version>${javax-jaxb.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.sun.xml.bind</groupId>
      <artifactId>jaxb-core</artifactId>
      <version>${jaxb-core.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.sun.xml.bind</groupId>
      <artifactId>jaxb-impl</artifactId>
      <version>${jaxb-impl.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <version>${assertj.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jacoco</groupId>
      <artifactId>org.jacoco.agent</artifactId>
      <classifier>runtime</classifier>
      <version>${jacoco.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.easymock</groupId>
      <artifactId>easymock</artifactId>
      <version>${easymock.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.powermock</groupId>
      <artifactId>powermock-module-junit4</artifactId>
      <version>${powermock.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.powermock</groupId>
      <artifactId>powermock-api-easymock</artifactId>
      <version>${powermock.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-oxm</artifactId>
      <version>${spring-framework.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.itelg.spring</groupId>
      <artifactId>spring-xom-unmarshaller</artifactId>
      <version>${spring-xom-unmarshaller.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.glassfish</groupId>
      <artifactId>javax.el</artifactId>
      <version>${javax.el.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.avides.springboot.springtainer</groupId>
      <artifactId>springtainer-rabbitmq</artifactId>
      <version>${springtainer-rabbitmq.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-test</artifactId>
      <version>${spring-framework.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-test</artifactId>
      <version>${spring-boot.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.awaitility</groupId>
      <artifactId>awaitility</artifactId>
      <version>${awaitility.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <repositories>
    <repository>
      <id>sonatype-oss</id>
      <url>https://oss.sonatype.org/content/repositories/releases</url>
    </repository>
  </repositories>

  <build>
    <plugins>
      <!-- BUILD AND FILES -->
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${maven-compiler-plugin.version}</version>
        <configuration>
          <source>${java.version}</source>
          <target>${java.version}</target>
        </configuration>
      </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.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>${maven-javadoc-plugin.version}</version>
        <configuration>
          <!-- Fix for https://bugs.openjdk.java.net/browse/JDK-8212233 -->
          <failOnError>false</failOnError>
        </configuration>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <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>
              <!-- Hopefully fixed in version 1.7 ? (https://issues.apache.org/jira/browse/MGPG-59) -->
              <gpgArguments>
                <arg>--pinentry-mode</arg>
                <arg>loopback</arg>
              </gpgArguments>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <!-- TEST AND COVERAGE -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven-surefire-plugin.version}</version>
        <configuration>
          <argLine>-Duser.timezone=Europe/Berlin</argLine>
          <systemPropertyVariables>
            <jacoco-agent.destfile>target/jacoco.exec</jacoco-agent.destfile>
          </systemPropertyVariables>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>${maven-failsafe-plugin.version}</version>
        <configuration>
          <reportsDirectory>target/surefire-reports</reportsDirectory>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>${maven-enforcer-plugin.version}</version>
        <configuration>
          <rules>
            <dependencyConvergence />
          </rules>
          <fail>false</fail>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>${jacoco.version}</version>
        <executions>
          <execution>
            <id>default-instrument</id>
            <goals>
              <goal>instrument</goal>
            </goals>
          </execution>
          <execution>
            <id>default-restore-instrumented-classes</id>
            <goals>
              <goal>restore-instrumented-classes</goal>
            </goals>
          </execution>
          <execution>
            <id>default-report</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>report</goal>
            </goals>
            <configuration>
              <dataFile>target/jacoco-ut.exec</dataFile>
              <outputDirectory>target/jacoco-ut</outputDirectory>
            </configuration>
          </execution>
          <execution>
            <id>integration-test-report</id>
            <phase>post-integration-test</phase>
            <goals>
              <goal>report</goal>
            </goals>
            <configuration>
              <dataFile>target/jacoco-it.exec</dataFile>
              <outputDirectory>target/jacoco-it</outputDirectory>
            </configuration>
          </execution>
          <execution>
            <id>agent</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>merge-results</id>
            <phase>verify</phase>
            <goals>
              <goal>merge</goal>
            </goals>
            <configuration>
              <fileSets>
                <fileSet>
                  <directory>target</directory>
                  <includes>
                    <include>*.exec</include>
                  </includes>
                </fileSet>
              </fileSets>
              <destFile>target/jacoco.exec</destFile>
            </configuration>
          </execution>
          <execution>
            <id>post-merge-report</id>
            <phase>verify</phase>
            <goals>
              <goal>report</goal>
            </goals>
            <configuration>
              <dataFile>target/jacoco.exec</dataFile>
              <outputDirectory>target/site/jacoco</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <!-- DEPLOYMENT -->
      <plugin>
        <artifactId>maven-release-plugin</artifactId>
        <version>${maven-release-plugin.version}</version>
        <configuration>
          <autoVersionSubmodules>true</autoVersionSubmodules>
          <useReleaseProfile>false</useReleaseProfile>
          <releaseProfiles>release</releaseProfiles>
          <goals>deploy</goals>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>org.apache.maven.scm</groupId>
            <artifactId>maven-scm-provider-gitexe</artifactId>
            <version>${maven-scm-provider-gitexe.version}</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <groupId>org.honton.chas</groupId>
        <artifactId>exists-maven-plugin</artifactId>
        <version>${exists-maven-plugin.version}</version>
        <configuration>
          <property>skip-deploy-to-central</property>
          <repository>https://oss.sonatype.org/content/repositories/releases/</repository>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>remote</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>de.jutzig</groupId>
        <artifactId>github-release-plugin</artifactId>
        <version>${github-release-plugin.version}</version>
        <executions>
          <execution>
            <id>github-upload</id>
            <phase>deploy</phase>
            <goals>
              <goal>release</goal>
            </goals>
            <configuration>
              <releaseName>${project.version}</releaseName>
              <tag>${project.version}</tag>
              <artifact>${project.build.directory}/${project.artifactId}-${project.version}.jar</artifact>
            </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>
          <skipRemoteStaging>${skip-deploy-to-central}</skipRemoteStaging>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
