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

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

  <groupId>com.azure.spring</groupId>
  <artifactId>azure-spring-boot-starter-active-directory</artifactId>
  <version>3.11.0</version> <!-- {x-version-update;com.azure.spring:azure-spring-boot-starter-active-directory;current} -->

  <name>Azure Spring Boot Starter for Azure AD Spring Security Integration</name>
  <description>Spring Boot Starter for Azure AD and Spring Security Integration</description>
  <url>https://github.com/Azure/azure-sdk-for-java</url>

  <dependencies>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter</artifactId>
      <version>2.5.4</version> <!-- {x-version-update;org.springframework.boot:spring-boot-starter;external_dependency} -->
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-validation</artifactId>
      <version>2.5.4</version> <!-- {x-version-update;org.springframework.boot:spring-boot-starter-validation;external_dependency} -->
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-webflux</artifactId>
      <version>2.5.4</version> <!-- {x-version-update;org.springframework.boot:spring-boot-starter-webflux;external_dependency} -->
    </dependency>
    <dependency>
      <groupId>com.azure.spring</groupId>
      <artifactId>azure-spring-boot</artifactId>
      <version>3.11.0</version> <!-- {x-version-update;com.azure.spring:azure-spring-boot;current} -->
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-web</artifactId>
      <version>5.3.9</version> <!-- {x-version-update;org.springframework:spring-web;external_dependency} -->
    </dependency>
    <dependency>
      <groupId>org.springframework.security</groupId>
      <artifactId>spring-security-core</artifactId>
      <version>5.6.0</version> <!-- {x-version-update;org.springframework.security:spring-security-core;external_dependency} -->
    </dependency>
    <dependency>
      <groupId>org.springframework.security</groupId>
      <artifactId>spring-security-web</artifactId>
      <version>5.6.0</version> <!-- {x-version-update;org.springframework.security:spring-security-web;external_dependency} -->
    </dependency>
    <dependency>
      <groupId>org.springframework.security</groupId>
      <artifactId>spring-security-config</artifactId>
      <version>5.6.0</version> <!-- {x-version-update;org.springframework.security:spring-security-config;external_dependency} -->
    </dependency>
    <dependency>
      <groupId>com.microsoft.azure</groupId>
      <artifactId>msal4j</artifactId>
      <version>1.11.0</version> <!-- {x-version-update;com.microsoft.azure:msal4j;external_dependency} -->
    </dependency>
    <dependency>
      <groupId>com.nimbusds</groupId>
      <artifactId>nimbus-jose-jwt</artifactId>
      <version>9.10.1</version> <!-- {x-version-update;com.nimbusds:nimbus-jose-jwt;external_dependency} -->
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
      <version>2.12.5</version> <!-- {x-version-update;com.fasterxml.jackson.core:jackson-databind;external_dependency} -->
    </dependency>
    <dependency>
      <groupId>io.projectreactor.netty</groupId>
      <artifactId>reactor-netty</artifactId>
      <version>1.0.11</version> <!-- {x-version-update;io.projectreactor.netty:reactor-netty;external_dependency} -->
    </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>com.fasterxml.jackson.core:jackson-databind:[2.12.5]</include> <!-- {x-include-update;com.fasterxml.jackson.core:jackson-databind;external_dependency} -->
                <include>com.microsoft.azure:msal4j:[1.11.0]</include> <!-- {x-include-update;com.microsoft.azure:msal4j;external_dependency} -->
                <include>com.nimbusds:nimbus-jose-jwt:[9.10.1]</include> <!-- {x-include-update;com.nimbusds:nimbus-jose-jwt;external_dependency} -->
                <include>io.projectreactor.netty:reactor-netty:[1.0.11]</include> <!-- {x-include-update;io.projectreactor.netty:reactor-netty;external_dependency} -->
                <include>org.springframework.boot:spring-boot-starter-validation:[2.5.4]</include> <!-- {x-include-update;org.springframework.boot:spring-boot-starter-validation;external_dependency} -->
                <include>org.springframework.boot:spring-boot-starter-webflux:[2.5.4]</include> <!-- {x-include-update;org.springframework.boot:spring-boot-starter-webflux;external_dependency} -->
                <include>org.springframework.boot:spring-boot-starter:[2.5.4]</include> <!-- {x-include-update;org.springframework.boot:spring-boot-starter;external_dependency} -->
                <include>org.springframework.security:spring-security-config:[5.6.0]</include> <!-- {x-include-update;org.springframework.security:spring-security-config;external_dependency} -->
                <include>org.springframework.security:spring-security-core:[5.6.0]</include> <!-- {x-include-update;org.springframework.security:spring-security-core;external_dependency} -->
                <include>org.springframework.security:spring-security-web:[5.6.0]</include> <!-- {x-include-update;org.springframework.security:spring-security-web;external_dependency} -->
                <include>org.springframework:spring-web:[5.3.9]</include> <!-- {x-include-update;org.springframework:spring-web;external_dependency} -->
              </includes>
            </bannedDependencies>
          </rules>
        </configuration>
      </plugin>
      <!-- BEGIN: Empty Java Doc & Sources -->
      <!-- The following code will generate an empty javadoc with just a README.md. This is necessary
           to pass the required checks on Maven. The way this works is by setting the classesDirectory
           to a directory that only contains the README.md, which we need to copy. If the classesDirectory
           is set to the root, where the README.md lives, it still won't have javadocs but the jar file
           will contain a bunch of files that shouldn't be there. The faux sources directory is deleted
           and recreated with the README.md being copied every time to guarantee that, when building locally,
           it'll have the latest copy of the README.md file.
      -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.3.1</version> <!-- {x-version-update;org.apache.maven.plugins:maven-javadoc-plugin;external_dependency} -->
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <skip>true</skip>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.1.2</version> <!-- {x-version-update;org.apache.maven.plugins:maven-jar-plugin;external_dependency} -->
        <executions>
          <!-- BEGIN: Empty Java Doc -->
          <execution>
            <id>empty-javadoc-jar-with-readme</id>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <classifier>javadoc</classifier>
              <classesDirectory>${project.basedir}/javadocTemp</classesDirectory>
            </configuration>
          </execution>
          <!-- END: Empty Java Doc -->
          <!-- BEGIN: Empty Sources -->
          <execution>
            <id>empty-sources-jar-with-readme</id>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <classifier>sources</classifier>
              <classesDirectory>${project.basedir}/sourceTemp</classesDirectory>
            </configuration>
          </execution>
          <!-- END: Empty Sources -->
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>1.8</version> <!-- {x-version-update;org.apache.maven.plugins:maven-antrun-plugin;external_dependency} -->
        <executions>
          <execution>
            <id>copy-readme-to-javadocTemp</id>
            <phase>prepare-package</phase>
            <configuration>
              <target>
                <echo>Deleting existing ${project.basedir}/javadocTemp</echo>
                <delete includeEmptyDirs="true" quiet="true">
                  <fileset dir="${project.basedir}/javadocTemp"/>
                </delete>
                <echo>Copying ${project.basedir}/README.md to
                  ${project.basedir}/javadocTemp/README.md
                </echo>
                <copy file="${project.basedir}/README.md" tofile="${project.basedir}/javadocTemp/README.md"/>
              </target>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
          <execution>
            <id>copy-readme-to-sourceTemp</id>
            <phase>prepare-package</phase>
            <configuration>
              <target>
                <echo>Deleting existing ${project.basedir}/sourceTemp</echo>
                <delete includeEmptyDirs="true" quiet="true">
                  <fileset dir="${project.basedir}/sourceTemp"/>
                </delete>
                <echo>Copying ${project.basedir}/README.md to
                  ${project.basedir}/sourceTemp/README.md
                </echo>
                <copy file="${project.basedir}/README.md" tofile="${project.basedir}/sourceTemp/README.md"/>
              </target>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.0.1</version> <!-- {x-version-update;org.apache.maven.plugins:maven-source-plugin;external_dependency} -->
        <executions>
          <execution>
            <id>attach-sources</id>
            <phase>none</phase> <!-- The way to skip the sources attach is to set the phase to none, the skip config doesn't work for sources -->
          </execution>
        </executions>
      </plugin>
      <!-- END: Empty Java Doc & Sources -->
    </plugins>
  </build>
</project>
