<?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">
  <parent>
    <artifactId>platform</artifactId>
    <groupId>org.open-metadata</groupId>
    <version>0.12.1</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>openmetadata-service</artifactId>

  <properties>
    <dropwizard.swagger.version>2.0.12-1</dropwizard.swagger.version>
    <sonar.junit.reportPaths>${project.basedir}/target/surefire-reports</sonar.junit.reportPaths>
    <sonar.coverage.jacoco.xmlReportPaths>${project.basedir}/target/site/jacoco-aggregate/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
    <sonar.tests>${project.basedir}/src/test/java</sonar.tests>
    <sonar.tests>${project.basedir}/src/test/java</sonar.tests>
    <org.testcontainers.version>1.17.4</org.testcontainers.version>
    <awssdk.version>2.17.286</awssdk.version>
    <expiring.map.version>0.5.10</expiring.map.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.amazonaws</groupId>
        <artifactId>aws-java-sdk-bom</artifactId>
        <version>${awssdk.version}</version>
        <type>pom</type>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>org.open-metadata</groupId>
      <artifactId>common</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.antlr</groupId>
      <artifactId>antlr4-runtime</artifactId>
    </dependency>
    <dependency>
      <groupId>com.macasaet.fernet</groupId>
      <artifactId>fernet-java8</artifactId>
    </dependency>
    <dependency>
      <groupId>org.open-metadata</groupId>
      <artifactId>openmetadata-spec</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>io.dropwizard</groupId>
      <artifactId>dropwizard-assets</artifactId>
    </dependency>
    <dependency>
      <groupId>io.dropwizard</groupId>
      <artifactId>dropwizard-core</artifactId>
    </dependency>
    <dependency>
      <groupId>io.dropwizard</groupId>
      <artifactId>dropwizard-jdbi3</artifactId>
    </dependency>
    <dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
    </dependency>
    <dependency>
        <groupId>org.postgresql</groupId>
        <artifactId>postgresql</artifactId>
    </dependency>
    <dependency>
      <groupId>io.swagger.core.v3</groupId>
      <artifactId>swagger-annotations</artifactId>
    </dependency>
    <dependency>
      <groupId>com.smoketurner</groupId>
      <artifactId>dropwizard-swagger</artifactId>
      <version>${dropwizard.swagger.version}</version>
      <exclusions>
        <exclusion>
          <groupId>io.dropwizard</groupId>
          <artifactId>dropwizard-core</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.google.code.findbugs</groupId>
          <artifactId>annotations</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.eclipse.jetty</groupId>
          <artifactId>jetty-io</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.glassfish</groupId>
          <artifactId>jakarta.el</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jersey.media</groupId>
      <artifactId>jersey-media-multipart</artifactId>
    </dependency>
    <dependency>
      <groupId>io.github.maksymdolgykh.dropwizard</groupId>
      <artifactId>dropwizard-micrometer-core</artifactId>
    </dependency>
    <dependency>
      <groupId>io.github.maksymdolgykh.dropwizard</groupId>
      <artifactId>dropwizard-micrometer-jdbi</artifactId>
    </dependency>
    <dependency>
      <groupId>commons-lang</groupId>
      <artifactId>commons-lang</artifactId>
      <version>${commons-lang.version}</version>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
    </dependency>
    <dependency>
      <groupId>org.elasticsearch.client</groupId>
      <artifactId>elasticsearch-rest-high-level-client</artifactId>
      <exclusions>
        <exclusion>
          <groupId>org.apache.lucene</groupId>
          <artifactId>lucene-analyzers-common</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.lucene</groupId>
          <artifactId>lucene-backward-codecs</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.lucene</groupId>
          <artifactId>lucene-grouping</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.lucene</groupId>
          <artifactId>lucene-memory</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.lucene</groupId>
          <artifactId>lucene-misc</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.lucene</groupId>
          <artifactId>lucene-sandbox</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.lucene</groupId>
          <artifactId>lucene-spatial</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.lucene</groupId>
          <artifactId>lucene-spatial-extras</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.lucene</groupId>
          <artifactId>lucene-spatial3d</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.apache.lucene</groupId>
          <artifactId>lucene-suggest</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.fasterxml.jackson.dataformat</groupId>
          <artifactId>jackson-dataformat-cbor</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpasyncclient</artifactId>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-annotations</artifactId>
    </dependency>
    <dependency>
      <groupId>io.dropwizard.modules</groupId>
      <artifactId>dropwizard-health</artifactId>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
    </dependency>
    <dependency>
      <groupId>org.glassfish.jersey.media</groupId>
      <artifactId>jersey-media-json-jackson</artifactId>
      <exclusions>
        <!-- excluded as these are conflicting with dropwizard jersey-jackson dependencies -->
        <exclusion>
          <groupId>com.fasterxml.jackson.core</groupId>
          <artifactId>jackson-core</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.fasterxml.jackson.jaxrs</groupId>
          <artifactId>jackson-jaxrs-base</artifactId>
        </exclusion>
        <exclusion>
          <groupId>com.fasterxml.jackson.jaxrs</groupId>
          <artifactId>jackson-jaxrs-json-provider</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>commons-cli</groupId>
      <artifactId>commons-cli</artifactId>
    </dependency>
    <dependency>
      <groupId>org.flywaydb</groupId>
      <artifactId>flyway-maven-plugin</artifactId>
    </dependency>
    <dependency>
      <groupId>org.flywaydb</groupId>
      <artifactId>flyway-mysql</artifactId>
    </dependency>

    <!-- Diff util to compute diffs in plain text -->
    <dependency>
      <groupId>io.github.java-diff-utils</groupId>
      <artifactId>java-diff-utils</artifactId>
      <version>4.12</version>
    </dependency>

    <!-- Dependencies for secret store manager providers -->
    <dependency>
      <groupId>software.amazon.awssdk</groupId>
      <artifactId>secretsmanager</artifactId>
      <version>${awssdk.version}</version>
    </dependency>
    <dependency>
      <groupId>software.amazon.awssdk</groupId>
      <artifactId>ssm</artifactId>
      <version>${awssdk.version}</version>
    </dependency>

    <!--test dependencies-->
    <dependency>
      <groupId>org.glassfish.jersey.core</groupId>
      <artifactId>jersey-client</artifactId>
    </dependency>
    <dependency>
      <groupId>org.awaitility</groupId>
      <artifactId>awaitility</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.dropwizard</groupId>
      <artifactId>dropwizard-testing</artifactId>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-inline</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.projectlombok</groupId>
      <artifactId>lombok</artifactId>
    </dependency>
    <dependency>
      <groupId>org.testcontainers</groupId>
      <artifactId>testcontainers</artifactId>
      <version>${org.testcontainers.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.testcontainers</groupId>
      <artifactId>junit-jupiter</artifactId>
      <version>${org.testcontainers.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.testcontainers</groupId>
      <artifactId>postgresql</artifactId>
      <version>${org.testcontainers.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.testcontainers</groupId>
      <artifactId>mysql</artifactId>
      <version>${org.testcontainers.version}</version>
      <scope>test</scope>
    </dependency>
    <!-- JSON-P: Java API for JSON Processing (JSR 374) -->
    <dependency>
      <groupId>javax.json</groupId>
      <artifactId>javax.json-api</artifactId>
    </dependency>

    <!-- Apache Johnzon: Implementation of the Java API for JSON Processing (JSR 374) -->
    <dependency>
      <groupId>org.apache.johnzon</groupId>
      <artifactId>johnzon-core</artifactId>
    </dependency>
    <dependency>
      <groupId>com.fasterxml.jackson.datatype</groupId>
      <artifactId>jackson-datatype-jsr353</artifactId>
    </dependency>

    <!-- https://mvnrepository.com/artifact/org.json/json -->
    <dependency>
      <groupId>org.json</groupId>
      <artifactId>json</artifactId>
      <version>20220924</version>
    </dependency>

    <dependency>
      <groupId>com.networknt</groupId>
      <artifactId>json-schema-validator</artifactId>
      <version>${json-schema-validator.version}</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/io.jsonwebtoken/jjwt -->
    <dependency>
      <groupId>io.jsonwebtoken</groupId>
      <artifactId>jjwt</artifactId>
      <version>${jjwt.version}</version>
    </dependency>


    <!-- https://mvnrepository.com/artifact/com.auth0/java-jwt -->
    <dependency>
      <groupId>com.auth0</groupId>
      <artifactId>java-jwt</artifactId>
      <version>${java-jwt.version}</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/com.auth0/jwks-rsa -->
    <dependency>
      <groupId>com.auth0</groupId>
      <artifactId>jwks-rsa</artifactId>
      <version>${jwks-rsa.version}</version>
    </dependency>
    <dependency>
      <groupId>io.github.artsok</groupId>
      <artifactId>rerunner-jupiter</artifactId>
      <version>${rerunner-jupiter.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.lmax</groupId>
      <artifactId>disruptor</artifactId>
    </dependency>
    <dependency>
      <groupId>io.socket</groupId>
      <artifactId>socket.io-server</artifactId>
      <version>4.0.1</version>
    </dependency>
    <dependency>
      <groupId>io.socket</groupId>
      <artifactId>engine.io-server-jetty</artifactId>
      <version>6.2.1</version>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty.websocket</groupId>
      <artifactId>websocket-server</artifactId>
      <version>9.4.46.v20220331</version>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-expression</artifactId>
      <version>${spring.version}</version>
    </dependency>
    <dependency>
      <groupId>at.favre.lib</groupId>
      <artifactId>bcrypt</artifactId>
      <version>${bcrypt.version}</version>
    </dependency>
    <dependency>
      <groupId>org.simplejavamail</groupId>
      <artifactId>simple-java-mail</artifactId>
      <version>${simplejavamail.version}</version>
    </dependency>
    <dependency>
      <groupId>org.passay</groupId>
      <artifactId>passay</artifactId>
      <version>${passay.version}</version>
    </dependency>
    <!--Template engine-->
    <dependency>
      <groupId>org.freemarker</groupId>
      <artifactId>freemarker</artifactId>
      <version>${freemarker.version}</version>
    </dependency>
    <dependency>
      <groupId>net.jodah</groupId>
      <artifactId>expiringmap</artifactId>
      <version>${expiring.map.version}</version>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
        <version>1.5</version>
        <executions>
          <execution>
            <id>sign-artifacts</id>
            <phase>verify</phase>
            <goals>
              <goal>sign</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.antlr</groupId>
        <artifactId>antlr4-maven-plugin</artifactId>
        <version>${antlr.version}</version>
        <executions>
          <execution>
            <phase>generate-resources</phase>
            <goals>
              <goal>antlr4</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.theoryinpractise</groupId>
        <artifactId>googleformatter-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>buildnumber-maven-plugin</artifactId>
        <version>1.4</version>
        <configuration>
          <doCheck>false</doCheck>
          <doUpdate>false</doUpdate>
          <outputDirectory>${project.build.directory}/classes/catalog</outputDirectory>
          <outputName>VERSION</outputName>
        </configuration>
        <executions>
          <execution>
            <phase>generate-resources</phase>
            <goals>
              <goal>create-metadata</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>io.openapitools.swagger</groupId>
        <artifactId>swagger-maven-plugin</artifactId>
        <configuration>
          <resourcePackages>
            <resourcePackage>org.openmetadata.service.resources</resourcePackage>
          </resourcePackages>
          <useResourcePackagesChildren>true</useResourcePackagesChildren>
          <outputDirectory>${basedir}/target/classes/assets/</outputDirectory>
          <outputFilename>swagger</outputFilename>
          <outputFormats>JSON,YAML</outputFormats>
          <prettyPrint>true</prettyPrint>
          <swaggerConfig>
            <servers>
              <server>
                <url>http://localhost:8585/api</url>
                <description>Endpoint URL</description>
              </server>
            </servers>
            <info>
              <title>OpenMetadata Apis</title>
              <version>${project.parent.version}</version>
              <contact>
                <email>openmetadata-dev@googlegroups.com</email>
                <name>OpenMetadata</name>
                <url>https://open-metadata.org</url>
              </contact>
              <license>
                <url>https://www.apache.org/licenses/LICENSE-2.0</url>
                <name>Apache 2.0</name>
              </license>
            </info>
            <descriptionFile>../openmetadata-docs/content/main-concepts/metadata-standard/apis.md</descriptionFile>
          </swaggerConfig>
        </configuration>
        <executions>
          <execution>
            <phase>compile</phase>
            <goals>
              <goal>generate</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.10.3</version>
        <configuration>
          <additionalparam>-Xdoclint:none</additionalparam>
        </configuration>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven-surefire.version}</version>
        <configuration>
          <trimStackTrace>false</trimStackTrace>
        </configuration>
        <executions>
          <execution>
            <id>default-test</id>
            <configuration>
              <skip>true</skip>
            </configuration>
          </execution>
          <execution>
            <goals>
              <goal>test</goal>
            </goals>
            <id>unit-tests</id>
            <configuration>
              <excludes>**/*ResourceTest.java</excludes>
              <systemPropertyVariables>
                <jdbcContainerClassName>org.testcontainers.containers.MySQLContainer</jdbcContainerClassName>
                <jdbcContainerImage>mysql:8</jdbcContainerImage>
              </systemPropertyVariables>
            </configuration>
          </execution>
          <execution>
            <goals>
              <goal>test</goal>
            </goals>
            <id>postgres-integration-tests</id>
            <phase>test</phase>
            <configuration>
              <includes>
                <include>**/*ResourceTest.java</include>
              </includes>
              <systemPropertyVariables>
                <jdbcContainerClassName>org.testcontainers.containers.PostgreSQLContainer</jdbcContainerClassName>
                <jdbcContainerImage>postgres:12.10</jdbcContainerImage>
              </systemPropertyVariables>
            </configuration>
          </execution>
          <execution>
            <goals>
              <goal>test</goal>
            </goals>
            <id>mysql-integration-tests</id>
            <phase>test</phase>
            <configuration>
              <includes>
                <include>**/*ResourceTest.java</include>
              </includes>
              <systemPropertyVariables>
                <jdbcContainerClassName>org.testcontainers.containers.MySQLContainer</jdbcContainerClassName>
                <jdbcContainerImage>mysql:8</jdbcContainerImage>
              </systemPropertyVariables>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
