<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/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <groupId>io.confluent</groupId>
  <artifactId>cc-role-definitions-parent</artifactId>
  <name>cc-role-definitions</name>
  <version>8.0.2</version>

  <packaging>pom</packaging>

  <organization>
    <name>Confluent, Inc.</name>
    <url>http://confluent.io</url>
  </organization>
  <url>http://confluent.io</url>
  <description>
    Cloud Role Definitions for Confluent Cloud
  </description>

  <licenses>
    <license>
      <name>Confluent License Agreement</name>
      <url>https://www.confluent.io/legal/confluent-license-agreement/</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <modules>
    <module>role-definitions</module>
  </modules>

  <properties>
    <java.version>8</java.version>
    <maven-compiler-plugin.version>3.14.0</maven-compiler-plugin.version>
    <maven-jar-plugin.version>3.4.2</maven-jar-plugin.version>
    <buildnumber-plugin.version>1.4</buildnumber-plugin.version>
    <maven-checkstyle-plugin.version>3.6.0</maven-checkstyle-plugin.version>
    <checkstyle.version>9.3</checkstyle.version>
    <checkstyle.config.location>checkstyle/checkstyle.xml</checkstyle.config.location>
    <checkstyle.suppressions.location>checkstyle/common-suppressions.xml
    </checkstyle.suppressions.location>
    <maven-enforcer-plugin.version>3.5.0</maven-enforcer-plugin.version>
    <required.maven.version>3.2</required.maven.version>
    <io.confluent.cc-role-definitions.version>8.0.2</io.confluent.cc-role-definitions.version> <!-- Do not remove this property -->
  </properties>

  <dependencies>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-annotations</artifactId>
      <version>2.18.3</version>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
      <version>2.18.3</version>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.datatype</groupId>
      <artifactId>jackson-datatype-jdk8</artifactId>
      <version>2.18.3</version>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.dataformat</groupId>
      <artifactId>jackson-dataformat-yaml</artifactId>
      <version>2.18.3</version>
    </dependency>

    <!--test-->
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <version>5.12.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-params</artifactId>
      <version>5.12.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.reflections</groupId>
      <artifactId>reflections</artifactId>
      <version>0.10.2</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <scm>
    <connection>scm:git:git://github.com/confluentinc/cc-rbac-services.git</connection>
    <developerConnection>scm:git:git@github.com:confluentinc/cc-rbac-services.git
    </developerConnection>
    <url>https://github.com/confluentinc/cc-rbac-services</url>
    <tag>HEAD</tag>
  </scm>

  <repositories>
    <repository>
      <id>confluent</id>
      <name>Confluent</name>
      <url>https://packages.confluent.io/maven/</url>
    </repository>
  </repositories>

  <pluginRepositories>
    <pluginRepository>
      <id>confluent</id>
      <url>https://packages.confluent.io/maven/</url>
    </pluginRepository>
  </pluginRepositories>

  <distributionManagement>
    <repository>
      <id>aws-release</id>
      <name>AWS Release Repository</name>
      <url>${confluent.release.repo}</url>
    </repository>
    <snapshotRepository>
      <id>aws-snapshot</id>
      <name>AWS Snapshot Repository</name>
      <url>${confluent.snapshot.repo}</url>
    </snapshotRepository>
  </distributionManagement>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>${maven-checkstyle-plugin.version}</version>
          <configuration>
            <configLocation>${checkstyle.config.location}</configLocation>
            <suppressionsLocation>${checkstyle.suppressions.location}</suppressionsLocation>
            <sourceDirectories>
              <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
            </sourceDirectories>
            <encoding>UTF-8</encoding>
            <consoleOutput>true</consoleOutput>
            <failsOnError>true</failsOnError>
            <failOnViolation>true</failOnViolation>
            <includeResources>false</includeResources>
            <includeTestResources>false</includeTestResources>
          </configuration>
          <dependencies>
            <dependency>
              <groupId>com.puppycrawl.tools</groupId>
              <artifactId>checkstyle</artifactId>
              <version>${checkstyle.version}</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${maven-compiler-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>${maven-jar-plugin.version}</version>
          <configuration>
            <archive>
              <manifestEntries>
                <Commit-ID>${gitCommitID}</Commit-ID>
              </manifestEntries>
            </archive>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>${maven-enforcer-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>buildnumber-maven-plugin</artifactId>
          <version>${buildnumber-plugin.version}</version>
          <executions>
            <execution>
              <phase>validate</phase>
              <goals>
                <goal>create</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <doCheck>false</doCheck>
            <doUpdate>false</doUpdate>
            <buildNumberPropertyName>gitCommitID</buildNumberPropertyName>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <inherited>true</inherited>
        <configuration>
          <source>${java.version}</source>
          <target>${java.version}</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>buildnumber-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <executions>
          <execution>
            <id>validate</id>
            <phase>validate</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
<!--      This enforces that we do not introduce a new io.confluent dependency 
          which will be incompatible with CP. See: https://confluentinc.atlassian.net/wiki/spaces/IM/pages/4252401795/INC-455+SEV-2+CP+8.0.x+build+is+failing+due+to+failure+to+build+cc-role-definitions
          for full context on the issue. -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <id>enforce-versions</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>${required.maven.version}</version>
                </requireMavenVersion>
                <bannedDependencies>
                  <excludes>
                    <exclude>io.confluent:*:*</exclude>
                  </excludes>
                  <includes>
                    <include>io.confluent:cc-role-definitions-parent:8.0.0-0</include>
                  </includes>
                </bannedDependencies>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <!-- This plugin generates the aggregate SBOM of the project
          including ALL the required dependencies. The source based SBOMs
          are required for Dependency Mirrors, EOL and full accounting
          of components used in Confluent's portfolio -->
      <plugin>
        <groupId>org.cyclonedx</groupId>
        <artifactId>cyclonedx-maven-plugin</artifactId>
        <version>2.9.1</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>makeAggregateBom</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <projectType>library</projectType>
          <schemaVersion>1.4</schemaVersion>
          <includeBomSerialNumber>true</includeBomSerialNumber>
          <includeCompileScope>true</includeCompileScope>
          <includeProvidedScope>true</includeProvidedScope>
          <includeRuntimeScope>true</includeRuntimeScope>
          <includeSystemScope>true</includeSystemScope>
          <includeTestScope>true</includeTestScope>
          <includeLicenseText>false</includeLicenseText>
          <outputReactorProjects>true</outputReactorProjects>
          <outputFormat>all</outputFormat>
          <outputName>bom</outputName>
        </configuration>
      </plugin>
    </plugins>
    <extensions>
      <extension>
        <groupId>io.confluent</groupId>
        <artifactId>aws-maven</artifactId>
        <version>1.0.0</version>
      </extension>
    </extensions>
  </build>
</project>
