<?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">
  <parent>
    <groupId>com.azure</groupId>
    <artifactId>azure-client-sdk-parent</artifactId>
    <version>1.7.0</version> <!-- {x-version-update;com.azure:azure-client-sdk-parent;current} -->
    <relativePath>../../parents/azure-client-sdk-parent</relativePath>
  </parent>
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.azure.spring</groupId>
  <artifactId>azure-spring-cloud-context</artifactId>
  <version>2.6.0</version> <!-- {x-version-update;com.azure.spring:azure-spring-cloud-context;current} -->

  <name>Azure Spring Cloud Context</name>
  <url>https://github.com/Azure/azure-sdk-for-java</url>

  <properties>
    <jacoco.min.linecoverage>0.09</jacoco.min.linecoverage>
    <jacoco.min.branchcoverage>0.14</jacoco.min.branchcoverage>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context</artifactId>
      <version>5.3.7</version> <!-- {x-version-update;org.springframework:spring-context;external_dependency} -->
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-aop</artifactId>
      <version>2.5.0</version> <!-- {x-version-update;org.springframework.boot:spring-boot-starter-aop;external_dependency} -->
    </dependency>

    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-context-support</artifactId>
      <version>5.3.7</version> <!-- {x-version-update;org.springframework:spring-context-support;external_dependency} -->
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.5</version> <!-- {x-version-update;commons-io:commons-io;external_dependency} -->
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-configuration-processor</artifactId>
      <version>2.5.0</version> <!-- {x-version-update;org.springframework.boot:spring-boot-configuration-processor;external_dependency} -->
      <optional>true</optional>
    </dependency>

    <!-- com.azure.resourcemanager dependencies -->
    <dependency>
      <groupId>com.azure.resourcemanager</groupId>
      <artifactId>azure-resourcemanager</artifactId>
      <version>2.6.0</version> <!-- {x-version-update;com.azure.resourcemanager:azure-resourcemanager;dependency} -->
    </dependency>

    <!-- Identity -->
    <dependency>
      <groupId>com.azure.spring</groupId>
      <artifactId>azure-identity-spring</artifactId>
      <version>1.6.0</version> <!-- {x-version-update;com.azure.spring:azure-identity-spring;current} -->
    </dependency>

    <!-- test -->
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-test</artifactId>
      <version>2.5.0</version> <!-- {x-version-update;org.springframework.boot:spring-boot-starter-test;external_dependency} -->
      <scope>test</scope>
    </dependency>

    <!-- Added this dependency to include necessary annotations used by reactor core.
           Without this dependency, javadoc throws a warning as it cannot find enum When.MAYBE
           which is used in @Nullable annotation in reactor core classes -->
    <dependency>
      <groupId>com.google.code.findbugs</groupId>
      <artifactId>jsr305</artifactId>
      <version>3.0.2</version> <!-- {x-version-update;com.google.code.findbugs:jsr305;external_dependency} -->
      <scope>provided</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>3.0.0-M3</version> <!-- {x-version-update;org.apache.maven.plugins:maven-enforcer-plugin;external_dependency} -->
        <configuration>
          <rules>
            <bannedDependencies>
              <includes>
                <include>commons-io:commons-io:[2.5]</include> <!-- {x-include-update;commons-io:commons-io;external_dependency} -->
                <include>org.springframework.boot:spring-boot-configuration-processor:[2.5.0]</include> <!-- {x-include-update;org.springframework.boot:spring-boot-configuration-processor;external_dependency} -->
                <include>org.springframework.boot:spring-boot-starter-aop:[2.5.0]</include> <!-- {x-include-update;org.springframework.boot:spring-boot-starter-aop;external_dependency} -->
                <include>org.springframework:spring-context-support:[5.3.7]</include> <!-- {x-include-update;org.springframework:spring-context-support;external_dependency} -->
                <include>org.springframework:spring-context:[5.3.7]</include> <!-- {x-include-update;org.springframework:spring-context;external_dependency} -->
              </includes>
            </bannedDependencies>
          </rules>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <!-- Generate "spring-configuration-metadata.json" by annotation process -->
    <profile>
      <id>annotation-process-for-java-8</id>
      <activation>
        <jdk>[1.8,9)</jdk>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version> <!-- {x-version-update;org.apache.maven.plugins:maven-compiler-plugin;external_dependency} -->
            <executions>
              <execution>
                <id>annotation-process-for-java-8</id>
                <goals>
                  <goal>compile</goal>
                </goals>
                <configuration>
                  <compilerArgs>
                    <arg>-proc:only</arg> <!-- Turn on annotation processing -->
                  </compilerArgs>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>annotation-process-for-java-11</id>
      <activation>
        <jdk>[11,)</jdk>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version> <!-- {x-version-update;org.apache.maven.plugins:maven-compiler-plugin;external_dependency} -->
            <executions>
              <execution>
                <id>annotation-process-for-java-11</id>
                <goals>
                  <goal>compile</goal>
                </goals>
                <configuration>
                  <compilerArgs>
                    <arg>-proc:only</arg> <!-- Turn on annotation processing -->
                  </compilerArgs>
                  <release>11</release>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
