<?xml version="1.0" encoding="UTF-8"?>
<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>io.javaoperatorsdk</groupId>
  <artifactId>operator-framework-bom</artifactId>
  <version>5.1.3</version>
  <packaging>pom</packaging>
  <name>Operator SDK - Bill of Materials</name>
  <description>Java SDK for implementing Kubernetes operators</description>
  <url>https://github.com/operator-framework/java-operator-sdk</url>

  <licenses>
    <license>
      <name>Apache 2 License</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.html</url>
    </license>
  </licenses>
  <developers>
    <developer>
      <name>Attila Meszaros</name>
      <email>csviri@gmail.com</email>
    </developer>
    <developer>
      <name>Christophe Laprun</name>
      <email>claprun@redhat.com</email>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git://github.com/java-operator-sdk/java-operator-sdk.git</connection>
    <developerConnection>scm:git:git@github.com/java-operator-sdk/java-operator-sdk.git</developerConnection>
    <url>https://github.com/operator-framework/java-operator-sdk/tree/master</url>
  </scm>

  <properties>
    <maven-gpg-plugin.version>3.2.8</maven-gpg-plugin.version>
    <maven-source-plugin.version>3.3.1</maven-source-plugin.version>
    <maven-javadoc-plugin.version>3.12.0</maven-javadoc-plugin.version>
    <spotless.version>2.44.3</spotless.version>
    <central-publishing-maven-plugin.version>0.9.0</central-publishing-maven-plugin.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>io.javaoperatorsdk</groupId>
        <artifactId>operator-framework-core</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>io.javaoperatorsdk</groupId>
        <artifactId>operator-framework</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>io.javaoperatorsdk</groupId>
        <artifactId>micrometer-support</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>io.javaoperatorsdk</groupId>
        <artifactId>operator-framework-junit-5</artifactId>
        <version>${project.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <build>
    <plugins>
      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
        <configuration>
          <pom>
            <includes>
              <include>pom.xml</include>
              <include>./**/pom.xml</include>
            </includes>
            <sortPom>
              <expandEmptyElements>false</expandEmptyElements>
            </sortPom>
          </pom>
          <java>
            <googleJavaFormat>
              <reflowLongStrings>true</reflowLongStrings>
            </googleJavaFormat>
            <importOrder>
              <order>java,javax,org,io,com,,\#</order>
            </importOrder>
            <removeUnusedImports/>
          </java>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>apply</goal>
            </goals>
            <phase>compile</phase>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <excludes>
                <exclude>**/*IT.java</exclude>
                <exclude>**/*E2E.java</exclude>
                <exclude>**/InformerRelatedBehaviorTest.java</exclude>
              </excludes>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${maven-javadoc-plugin.version}</version>
            <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</goal>
                </goals>
                <phase>verify</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <goals>
                  <goal>sign</goal>
                </goals>
                <phase>verify</phase>
                <configuration>
                  <gpgArguments>
                    <arg>--pinentry-mode</arg>
                    <arg>loopback</arg>
                  </gpgArguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.sonatype.central</groupId>
            <artifactId>central-publishing-maven-plugin</artifactId>
            <version>${central-publishing-maven-plugin.version}</version>
            <extensions>true</extensions>
            <configuration>
              <publishingServerId>central</publishingServerId>
              <tokenAuth>true</tokenAuth>
              <autoPublish>true</autoPublish>
              <waitUntil>published</waitUntil>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
