<?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">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.cloudera.api</groupId>
  <artifactId>cloudera-manager-api</artifactId>
  <name>Cloudera Manager API</name>
  <version>7.13.2</version>
  <build>
    <resources>
      <resource>
        <filtering>true</filtering>
        <directory>${project.basedir}</directory>
        <includes>
          <include>openapi.fmt</include>
        </includes>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>filter-openapi-template</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/generated-resources</outputDirectory>
              <resources>
                <resource>
                  <directory>${project.basedir}</directory>
                  <includes>
                    <include>openapi.fmt</include>
                  </includes>
                  <filtering>true</filtering>
                </resource>
              </resources>
            </configuration>
          </execution>
          <execution>
            <id>copy-apidocs-js</id>
            <phase>package</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>
              <outputDirectory>${restapi.dir}/apidocs/js</outputDirectory>
              <resources>
                <resource>
                  <directory>${project.basedir}/static/js</directory>
                  <includes>
                    <include>apidocs.js</include>
                  </includes>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.12</version>
        <executions>
          <execution>
            <id>regex-property</id>
            <goals>
              <goal>regex-property</goal>
            </goals>
            <configuration>
              <name>python_client.version</name>
              <value>${project.version}</value>
              <regex>^(.+)\.(.+)\.(.+)$</regex>
              <replacement>${apiVersion}.0.$3</replacement>
              <failIfNoMatch>true</failIfNoMatch>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.cloudera.tools</groupId>
        <artifactId>api-flattener</artifactId>
        <version>${project.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <javaRelease>17</javaRelease>
              <sourceDirectory>${project.basedir}/src/main/java/com/cloudera/api</sourceDirectory>
              <targetDirectory>${project.build.directory}/generated-sources</targetDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.webcohesion.enunciate</groupId>
        <artifactId>enunciate-maven-plugin</artifactId>
        <version>2.15.0-cldr</version>
        <executions>
          <execution>
            <id>enunciate-api</id>
            <phase>process-classes</phase>
            <goals>
              <goal>docs</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <configFile>enunciate2.xml</configFile>
          <docsDir>${restapi.dir}</docsDir>
          <enunciateArtifactId>Cloudera Manager API Docs</enunciateArtifactId>
          <sources>
            <source>${project.basedir}/src/main/java</source>
            <source>${project.build.directory}/generated-sources</source>
          </sources>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.6.0</version>
        <executions>
          <execution>
            <id>update_index_html</id>
            <phase>package</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <executable>python</executable>
              <workingDirectory>${project.basedir}</workingDirectory>
              <arguments>
                <argument>swagger-utils.py</argument>
                <argument>${restapi.dir}/apidocs/ui/index.html</argument>
                <argument>${restapi.dir}/apidocs/ui/swagger-ui.css</argument>
                <argument>${restapi.dir}/apidocs/ui/swagger-ui-standalone-preset.js</argument>
                <argument>${project.basedir}/static/cms/icons/manager-logo.svg</argument>
                <argument>${restapi.dir}/apidocs/</argument>
              </arguments>
            </configuration>
          </execution>
          <execution>
            <id>check-api-breaking-changes</id>
            <phase>process-classes</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <executable>${project.basedir}/check-api-diff.sh</executable>
              <workingDirectory>${project.basedir}</workingDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>io.swagger.codegen.v3</groupId>
        <artifactId>swagger-codegen-maven-plugin</artifactId>
        <version>3.0.71</version>
        <executions>
          <execution>
            <id>java-client</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <templateDirectory>${project.basedir}/swagger/templates/java/</templateDirectory>
              <inputSpec>${restapi.dir}/apidocs/ui/openapi.json</inputSpec>
              <language>java</language>
              <library>okhttp4-gson</library>
              <typeMappings>
                <typeMapping>Integer=java.math.BigDecimal</typeMapping>
              </typeMappings>
              <output>${project.build.directory}/swagger/java</output>
              <configOptions>
                <dateLibrary>java8</dateLibrary>
                <groupId>com.cloudera.api.swagger</groupId>
                <artifactId>cloudera-manager-api-swagger</artifactId>
                <artifactVersion>${project.version}</artifactVersion>
                <java11>true</java11>
              </configOptions>
              <apiPackage>com.cloudera.api.swagger</apiPackage>
              <modelPackage>com.cloudera.api.swagger.model</modelPackage>
              <invokerPackage>com.cloudera.api.swagger.client</invokerPackage>
              <environmentVariables>
                <maxYamlCodePoints>99999999</maxYamlCodePoints>
              </environmentVariables>
            </configuration>
          </execution>
          <execution>
            <id>python-client</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <templateDirectory>${project.basedir}/swagger/templates/python/</templateDirectory>
              <inputSpec>${restapi.dir}/apidocs/ui/openapi.json</inputSpec>
              <language>python</language>
              <output>${project.build.directory}/swagger/python</output>
              <apiPackage>apis</apiPackage>
              <modelPackage>models</modelPackage>
              <configOptions>
                <packageName>cm_client</packageName>
                <packageVersion>${python_client.version}</packageVersion>
              </configOptions>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.ruleoftech</groupId>
        <artifactId>markdown-page-generator-plugin</artifactId>
        <version>2.1.0</version>
        <executions>
          <execution>
            <phase>prepare-package</phase>
            <goals>
              <goal>generate</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <headerHtmlFile>${project.basedir}/swagger-client-sdk-header.html</headerHtmlFile>
          <inputDirectory>${project.build.directory}/swagger</inputDirectory>
          <outputDirectory>${project.build.directory}/swagger-html-sdk-docs</outputDirectory>
          <recursiveInput>true</recursiveInput>
          <transformRelativeMarkdownLinks>true</transformRelativeMarkdownLinks>
          <pegdownExtensions>TABLES,HARDWRAPS,FENCED_CODE_BLOCKS,AUTOLINKS,STRIKETHROUGH,ATXHEADERSPACE,TASKLISTITEMS,ANCHORLINKS</pegdownExtensions>
          <attributes>
            <attribute>TableBlock|class=table table-striped table-bordered</attribute>
          </attributes>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.11.0</version>
        <configuration>
          <release>17</release>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <shadedArtifactAttached>true</shadedArtifactAttached>
              <shadedClassifierName>shaded</shadedClassifierName>
              <artifactSet>
                <includes>
                  <include>com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider</include>
                  <include>com.fasterxml.jackson.core:*</include>
                  <include>com.fasterxml.jackson.databind:jackson-databind</include>
                  <include>com.fasterxml.jackson.module:jackson-module-jaxb-annotations</include>
                  <include>com.google.guava:guava</include>
                  <include>com.google.guava:failureaccess</include>
                  <include>joda-time:joda-time*</include>
                </includes>
              </artifactSet>
              <relocations>
                <relocation>
                  <pattern>com.</pattern>
                  <shadedPattern>${privateClassPath}.com.</shadedPattern>
                  <includes>
                    <include>com.google.common.**</include>
                  </includes>
                </relocation>
                <relocation>
                  <pattern>org.</pattern>
                  <shadedPattern>${privateClassPath}.org.</shadedPattern>
                  <includes>
                    <include>org.joda.time.**</include>
                  </includes>
                </relocation>
              </relocations>
              <filters>
                <filter>
                  <artifact>com.fasterxml.jackson.core:jackson-core</artifact>
                  <excludes>
                    <exclude>**/module-info.class</exclude>
                    <exclude>META-INF/MANIFEST.MF</exclude>
                    <exclude>META-INF/services/**</exclude>
                    <exclude>META-INF/versions/**</exclude>
                  </excludes>
                </filter>
              </filters>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.3.1</version>
        <executions>
          <execution>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.12.4</version>
        <dependencies>
          <dependency>
            <groupId>org.junit.vintage</groupId>
            <artifactId>junit-vintage-engine</artifactId>
            <version>5.12.1</version>
          </dependency>
        </dependencies>
        <configuration>
          <systemProperties>
            <java.awt.headless>true</java.awt.headless>
          </systemProperties>
          <redirectTestOutputToFile>${test.redirectToFile}</redirectTestOutputToFile>
          <useFile>${test.redirectToFile}</useFile>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.4.0</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.github.spotbugs</groupId>
        <artifactId>spotbugs-maven-plugin</artifactId>
        <version>${spotbugsVersion}</version>
        <configuration>
          <excludeFilterFile>findbugs-exclude.xml</excludeFilterFile>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.owasp</groupId>
        <artifactId>dependency-check-maven</artifactId>
        <version>1.4.3</version>
      </plugin>
      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>3.4.1</version>
        <executions>
          <execution>
            <phase>validate</phase>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <bannedDependencies>
                  <message>Kotlin stdlib is excluded from the CM dependency tree.</message>
                  <excludes>
                    <exclude>org.jetbrains.kotlin:*</exclude>
                  </excludes>
                </bannedDependencies>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>clover</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.atlassian.maven.plugins</groupId>
            <artifactId>maven-clover2-plugin</artifactId>
            <version>${clover.version}</version>
            <configuration>
              <generateHtml>${clover.generateHtml}</generateHtml>
              <generateXml>${clover.generateXml}</generateXml>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <dependencies>
        <dependency>
          <groupId>com.atlassian.clover</groupId>
          <artifactId>clover</artifactId>
          <version>${clover.version}</version>
        </dependency>
      </dependencies>
      <properties>
        <clover.generateXml>true</clover.generateXml>
        <clover.generateHtml>true</clover.generateHtml>
        <clover.version>4.0.3</clover.version>
      </properties>
    </profile>
  </profiles>
  <dependencies>
    <dependency>
      <groupId>com.fasterxml.jackson.datatype</groupId>
      <artifactId>jackson-datatype-joda</artifactId>
      <version>2.18.6</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.ow2.asm</groupId>
      <artifactId>asm</artifactId>
      <version>9.4</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-rt-rs-client</artifactId>
      <version>3.6.12</version>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <artifactId>woodstox-core</artifactId>
          <groupId>com.fasterxml.woodstox</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-rt-features-logging</artifactId>
      <version>3.6.12</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>javax.annotation</groupId>
      <artifactId>jsr250-api</artifactId>
      <version>1.0</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <version>4.0.1</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>commons-lang</groupId>
      <artifactId>commons-lang</artifactId>
      <version>2.6</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>hamcrest-core</artifactId>
          <groupId>org.hamcrest</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest</artifactId>
      <version>2.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>3.6.28</version>
      <scope>test</scope>
      <exclusions>
        <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>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>javax.ws.rs</groupId>
      <artifactId>javax.ws.rs-api</artifactId>
      <version>2.1.1</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>javax.xml.bind</groupId>
      <artifactId>jaxb-api</artifactId>
      <version>2.4.0-b180830.0359</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>javax.annotation</groupId>
      <artifactId>javax.annotation-api</artifactId>
      <version>1.3.2</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>javax.activation</groupId>
      <artifactId>activation</artifactId>
      <version>1.1.1</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.webcohesion.enunciate</groupId>
      <artifactId>enunciate-core-annotations</artifactId>
      <version>2.15.0</version>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <artifactId>commons-configuration2</artifactId>
          <groupId>org.apache.commons</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-configuration2</artifactId>
      <version>2.10.1</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-collections4</artifactId>
      <version>4.5.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>io.swagger.core.v3</groupId>
      <artifactId>swagger-annotations</artifactId>
      <version>2.2.20</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.google.code.gson</groupId>
      <artifactId>gson</artifactId>
      <version>2.9.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.squareup.okhttp3</groupId>
      <artifactId>okhttp</artifactId>
      <version>4.12.0</version>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <artifactId>kotlin-stdlib</artifactId>
          <groupId>org.jetbrains.kotlin</groupId>
        </exclusion>
        <exclusion>
          <artifactId>kotlin-stdlib-common</artifactId>
          <groupId>org.jetbrains.kotlin</groupId>
        </exclusion>
        <exclusion>
          <artifactId>kotlin-stdlib-jdk7</artifactId>
          <groupId>org.jetbrains.kotlin</groupId>
        </exclusion>
        <exclusion>
          <artifactId>kotlin-stdlib-jdk8</artifactId>
          <groupId>org.jetbrains.kotlin</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.squareup.okhttp3</groupId>
      <artifactId>logging-interceptor</artifactId>
      <version>4.12.0</version>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <artifactId>kotlin-stdlib</artifactId>
          <groupId>org.jetbrains.kotlin</groupId>
        </exclusion>
        <exclusion>
          <artifactId>kotlin-stdlib-common</artifactId>
          <groupId>org.jetbrains.kotlin</groupId>
        </exclusion>
        <exclusion>
          <artifactId>kotlin-stdlib-jdk7</artifactId>
          <groupId>org.jetbrains.kotlin</groupId>
        </exclusion>
        <exclusion>
          <artifactId>kotlin-stdlib-jdk8</artifactId>
          <groupId>org.jetbrains.kotlin</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>io.gsonfire</groupId>
      <artifactId>gson-fire</artifactId>
      <version>1.9.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.cloudera.cmf</groupId>
      <artifactId>test-common</artifactId>
      <version>7.13.2</version>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.swagger</groupId>
      <artifactId>swagger-annotations</artifactId>
      <version>1.6.9</version>
      <scope>compile</scope>
      <optional>true</optional>
    </dependency>
  </dependencies>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.squareup.okio</groupId>
        <artifactId>okio-jvm</artifactId>
        <version>3.6.0</version>
        <exclusions>
          <exclusion>
            <artifactId>kotlin-stdlib</artifactId>
            <groupId>org.jetbrains.kotlin</groupId>
          </exclusion>
          <exclusion>
            <artifactId>kotlin-stdlib-common</artifactId>
            <groupId>org.jetbrains.kotlin</groupId>
          </exclusion>
          <exclusion>
            <artifactId>kotlin-stdlib-jdk7</artifactId>
            <groupId>org.jetbrains.kotlin</groupId>
          </exclusion>
          <exclusion>
            <artifactId>kotlin-stdlib-jdk8</artifactId>
            <groupId>org.jetbrains.kotlin</groupId>
          </exclusion>
        </exclusions>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <distributionManagement>
    <repository>
      <id>cdh.releases.repo</id>
      <name>CDH Releases Repository</name>
      <url>https://maven.jenkins.cloudera.com/artifactory/cdh-staging-local</url>
    </repository>
    <snapshotRepository>
      <id>cdh.snapshots.repo</id>
      <name>CDH Snapshots Repository</name>
      <url>https://maven.jenkins.cloudera.com/artifactory/libs-snapshot-local</url>
    </snapshotRepository>
  </distributionManagement>
  <properties>
    <test.redirectToFile>true</test.redirectToFile>
    <jackson2.version>2.18.6</jackson2.version>
    <apiVersionString>v${apiVersion}</apiVersionString>
    <guava.version>32.0.1-jre</guava.version>
    <hamcrest.version>2.2</hamcrest.version>
    <privateClassPath>com.cloudera.api.shaded</privateClassPath>
    <apiVersion>58</apiVersion>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <junit.version>4.12</junit.version>
    <javadocOptions>-Xdoclint:none</javadocOptions>
    <apiVersionFinalString>VFinal</apiVersionFinalString>
    <google-gson.version>2.9.0</google-gson.version>
    <mockito.version>3.6.28</mockito.version>
    <joda.version>2.10.13</joda.version>
    <baseUrl>/api/${apiVersionString}</baseUrl>
    <restapi.dir>${project.build.directory}/classes/restapi</restapi.dir>
    <spotbugsVersion>4.9.3.0</spotbugsVersion>
    <cxf.version>3.6.12</cxf.version>
  </properties>
</project>
