<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>
  <parent>
    <groupId>edu.utexas.tacc.tapis</groupId>
    <artifactId>tapis-client-java</artifactId>
    <version>1.2</version>
  </parent>

  <artifactId>systems-client</artifactId>

  <name>Tapis Systems Client</name>
  <description>Java client for Systems Service</description>

  <dependencies>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>shared</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>auth-client</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>${project.groupId}</groupId>
        <artifactId>tokens-client</artifactId>
        <version>${project.version}</version>
        <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <sourceDirectory>src/main/java</sourceDirectory>

    <plugins>
      <!-- Build generated client code using openapi-generator -->
      <plugin>
        <groupId>org.openapitools</groupId>
        <artifactId>openapi-generator-maven-plugin</artifactId>
        <version>${openapi-generator-maven-plugin.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <!-- Use the openapi spec here. Tapis live-docs website should also get spec from here -->
              <inputSpec>${project.basedir}/SystemsAPI.yaml</inputSpec>
              <enablePostProcessFile>true</enablePostProcessFile>
              <output>${project.build.directory}/generated-sources/openapi</output>
              <generatorName>java</generatorName>
              <groupId>edu.utexas.tacc.tapis</groupId>
              <invokerPackage>edu.utexas.tacc.tapis.systems.client.gen</invokerPackage>
              <apiPackage>edu.utexas.tacc.tapis.systems.client.gen.api</apiPackage>
              <modelPackage>edu.utexas.tacc.tapis.systems.client.gen.model</modelPackage>
              <!-- Turn off generation of stuff we do not need -->
              <generateApiTests>false</generateApiTests>
              <generateApiDocumentation>false</generateApiDocumentation>
              <generateModelTests>false</generateModelTests>
              <generateModelDocumentation>false</generateModelDocumentation>
              <configOptions>
                <sourceFolder>src/gen/java/main</sourceFolder>
                <!-- Use java 8 libraries instead of 3rd party libraries -->
                <java8>true</java8>
                <dateLibrary>java8</dateLibrary>
              </configOptions>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <configuration>
          <createDependencyReducedPom>false</createDependencyReducedPom>
        </configuration>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>

    <finalName>systems-client</finalName>
  </build>

</project>
