<?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/maven-v4_0_0.xsd">
  <parent>
    <artifactId>oxia-java</artifactId>
    <groupId>io.streamnative.oxia</groupId>
    <version>0.1.0</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>pulsar-metadatastore-oxia</artifactId>
  <name>Oxia Metadatastore implementation for Apache Pulsar</name>
  <build>
    <plugins>
      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
        <version>${spotless.plugin.version}</version>
        <executions>
          <execution>
            <id>check</id>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <pom>
            <sortPom>
              <expandEmptyElements>false</expandEmptyElements>
              <indentSchemaLocation>true</indentSchemaLocation>
              <nrOfIndentSpace>4</nrOfIndentSpace>
              <sortDependencies>scope,groupId,artifactId</sortDependencies>
              <sortDependencyExclusions>groupId,artifactId</sortDependencyExclusions>
              <sortPlugins>groupId,artifactId</sortPlugins>
            </sortPom>
          </pom>
          <java>
            <googleJavaFormat />
            <importOrder />
            <removeUnusedImports />
            <indent>
              <tabs>true</tabs>
              <spacesPerTab>2</spacesPerTab>
            </indent>
            <indent>
              <spaces>true</spaces>
              <spacesPerTab>4</spacesPerTab>
            </indent>
          </java>
          <markdown>
            <includes>
              <include>**/*.md</include>
            </includes>
            <flexmark />
          </markdown>
          <formats>
            <format>
              <includes>
                <include>etc/**/*.xml</include>
                <include>.github/workflows/**/*.yml</include>
              </includes>
              <trimTrailingWhitespace />
              <endWithNewline />
              <indent>
                <spaces>true</spaces>
                <spacesPerTab>4</spacesPerTab>
              </indent>
            </format>
          </formats>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.github.spotbugs</groupId>
        <artifactId>spotbugs-maven-plugin</artifactId>
        <version>${spotbugs.plugin.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <excludeFilterFile>etc/findbugsExclude.xml</excludeFilterFile>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>${license.plugin.version}</version>
        <executions>
          <execution>
            <phase>process-sources</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>com.mycila</groupId>
            <artifactId>license-maven-plugin-git</artifactId>
            <version>${license.plugin.version}</version>
          </dependency>
        </dependencies>
        <configuration>
          <header>etc/APACHE-2.txt</header>
          <mapping>
            <proto>DOUBLESLASH_STYLE</proto>
          </mapping>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>${checkstyle.plugin.version}</version>
        <executions>
          <execution>
            <phase>validate</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>com.puppycrawl.tools</groupId>
            <artifactId>checkstyle</artifactId>
            <version>${checkstyle.version}</version>
          </dependency>
        </dependencies>
        <configuration>
          <consoleOutput>true</consoleOutput>
          <failOnViolation>true</failOnViolation>
          <failsOnError>true</failsOnError>
          <configLocation>etc/checkstyle.xml</configLocation>
          <includeTestSourceDirectory>true</includeTestSourceDirectory>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>${maven.enforcer.plugin.version}</version>
        <executions>
          <execution>
            <id>enforce-maven-version</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>[3.8.6,)</version>
                </requireMavenVersion>
              </rules>
              <fail>true</fail>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <version>${maven.shade.plugin.version}</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <createSourcesJar>true</createSourcesJar>
              <shadedArtifactAttached>true</shadedArtifactAttached>
              <shadedClassifierName>shaded</shadedClassifierName>
              <relocations>
                <relocation>
                  <pattern>com.github.benmanes.caffeine</pattern>
                  <shadedPattern>${shade.relocation.package}.com.github.benmanes.caffeine</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.google</pattern>
                  <shadedPattern>${shade.relocation.package}.com.google</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.salesforce</pattern>
                  <shadedPattern>${shade.relocation.package}.com.salesforce</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>google</pattern>
                  <shadedPattern>${shade.relocation.package}.google</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>io.grpc</pattern>
                  <shadedPattern>${shade.relocation.package}.io.grpc</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>io.perfmark</pattern>
                  <shadedPattern>${shade.relocation.package}.io.perfmark</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>javax.annotation</pattern>
                  <shadedPattern>${shade.relocation.package}.javax.annotation</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>net.openhft</pattern>
                  <shadedPattern>${shade.relocation.package}.net.openhft</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.codehaus</pattern>
                  <shadedPattern>${shade.relocation.package}.org.codehaus</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>okio</pattern>
                  <shadedPattern>${shade.relocation.package}.okio</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.checkerframework</pattern>
                  <shadedPattern>${shade.relocation.package}.org.checkerframework</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.reactivestreams</pattern>
                  <shadedPattern>${shade.relocation.package}.org.reactivestreams</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>reactor</pattern>
                  <shadedPattern>${shade.relocation.package}.reactor</shadedPattern>
                </relocation>
              </relocations>
              <filters>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>module-info.class</exclude>
                    <exclude>META-INF/MANIFEST.MF</exclude>
                  </excludes>
                </filter>
              </filters>
              <transformers>
                <transformer />
                <transformer />
              </transformers>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>3.2.0</version>
        <executions>
          <execution>
            <id>add-source</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>target/generated-sources/protobuf/java</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>${jacoco.plugin.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>report</id>
            <phase>verify</phase>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
          <execution>
            <id>check</id>
            <phase>verify</phase>
            <goals>
              <goal>check</goal>
            </goals>
            <configuration>
              <rules>
                <rule>
                  <element>BUNDLE</element>
                  <limits>
                    <limit>
                      <counter>CLASS</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.00</minimum>
                    </limit>
                    <limit>
                      <counter>METHOD</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.00</minimum>
                    </limit>
                    <limit>
                      <counter>LINE</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.00</minimum>
                    </limit>
                    <limit>
                      <counter>BRANCH</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.00</minimum>
                    </limit>
                  </limits>
                </rule>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>org.apache.pulsar</groupId>
      <artifactId>pulsar-metadata</artifactId>
      <version>3.0.2</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <artifactId>grpc-core</artifactId>
          <groupId>io.grpc</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>io.dropwizard.metrics</groupId>
      <artifactId>metrics-core</artifactId>
      <version>4.1.12.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.streamnative.oxia</groupId>
      <artifactId>oxia-testcontainers</artifactId>
      <version>0.1.0</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>testcontainers</artifactId>
          <groupId>org.testcontainers</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.pulsar</groupId>
      <artifactId>buildtools</artifactId>
      <version>3.0.2</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>ant</artifactId>
          <groupId>org.apache.ant</groupId>
        </exclusion>
        <exclusion>
          <artifactId>ant-launcher</artifactId>
          <groupId>org.apache.ant</groupId>
        </exclusion>
        <exclusion>
          <artifactId>guice</artifactId>
          <groupId>com.google.inject</groupId>
        </exclusion>
        <exclusion>
          <artifactId>javax.inject</artifactId>
          <groupId>javax.inject</groupId>
        </exclusion>
        <exclusion>
          <artifactId>aopalliance</artifactId>
          <groupId>aopalliance</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jquery</artifactId>
          <groupId>org.webjars</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jcl-over-slf4j</artifactId>
          <groupId>org.slf4j</groupId>
        </exclusion>
        <exclusion>
          <artifactId>mockito-core</artifactId>
          <groupId>org.mockito</groupId>
        </exclusion>
        <exclusion>
          <artifactId>byte-buddy</artifactId>
          <groupId>net.bytebuddy</groupId>
        </exclusion>
        <exclusion>
          <artifactId>byte-buddy-agent</artifactId>
          <groupId>net.bytebuddy</groupId>
        </exclusion>
        <exclusion>
          <artifactId>objenesis</artifactId>
          <groupId>org.objenesis</groupId>
        </exclusion>
        <exclusion>
          <artifactId>mockito-inline</artifactId>
          <groupId>org.mockito</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.pulsar</groupId>
      <artifactId>pulsar-metadata</artifactId>
      <version>3.0.2</version>
      <type>test-jar</type>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>grpc-core</artifactId>
          <groupId>io.grpc</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.testng</groupId>
      <artifactId>testng</artifactId>
      <version>7.7.0</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>jquery</artifactId>
          <groupId>org.webjars</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.xerial.snappy</groupId>
      <artifactId>snappy-java</artifactId>
      <version>1.1.10.4</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
      <version>1.18.30</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <version>3.24.1</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>byte-buddy</artifactId>
          <groupId>net.bytebuddy</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.awaitility</groupId>
      <artifactId>awaitility</artifactId>
      <version>3.0.0</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>hamcrest-library</artifactId>
          <groupId>org.hamcrest</groupId>
        </exclusion>
        <exclusion>
          <artifactId>hamcrest-core</artifactId>
          <groupId>org.hamcrest</groupId>
        </exclusion>
        <exclusion>
          <artifactId>objenesis</artifactId>
          <groupId>org.objenesis</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.awaitility</groupId>
      <artifactId>awaitility-proxy</artifactId>
      <version>3.0.0</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>byte-buddy</artifactId>
          <groupId>net.bytebuddy</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <version>5.9.2</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>junit-jupiter-api</artifactId>
          <groupId>org.junit.jupiter</groupId>
        </exclusion>
        <exclusion>
          <artifactId>junit-jupiter-params</artifactId>
          <groupId>org.junit.jupiter</groupId>
        </exclusion>
        <exclusion>
          <artifactId>junit-jupiter-engine</artifactId>
          <groupId>org.junit.jupiter</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-junit-jupiter</artifactId>
      <version>4.11.0</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>junit-jupiter-api</artifactId>
          <groupId>org.junit.jupiter</groupId>
        </exclusion>
        <exclusion>
          <artifactId>mockito-core</artifactId>
          <groupId>org.mockito</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <version>1.7.32</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <properties>
    <jacoco.plugin.version>0.8.8</jacoco.plugin.version>
    <spotless.plugin.version>2.39.0</spotless.plugin.version>
    <license.plugin.version>4.1</license.plugin.version>
    <snappy.version>1.1.10.4</snappy.version>
    <maven.shade.plugin.version>3.4.1</maven.shade.plugin.version>
    <testng.version>7.7.0</testng.version>
    <shade.relocation.package>io.streamnative.pulsarmetadatastoreoxia.shaded</shade.relocation.package>
    <maven.compiler.plugin.version>3.10.1</maven.compiler.plugin.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <dropwizard.version>4.1.12.1</dropwizard.version>
    <maven.compiler.source>17</maven.compiler.source>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <maven.compiler.target>17</maven.compiler.target>
    <spotbugs.plugin.version>4.8.1.0</spotbugs.plugin.version>
    <checkstyle.version>10.3.3</checkstyle.version>
    <pulsar.version>3.0.2</pulsar.version>
    <checkstyle.plugin.version>3.2.0</checkstyle.plugin.version>
    <maven.surefire.plugin.version>3.0.0-M7</maven.surefire.plugin.version>
    <maven.enforcer.plugin.version>3.1.0</maven.enforcer.plugin.version>
  </properties>
</project>
