<?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.rws.lt.lc.public-api</groupId>
  <artifactId>lc-public-api-sdk</artifactId>
  <name>LC Public API SDK</name>
  <version>1.0.17-beta</version>
  <description>Client implementation for Language Cloud Public API.</description>
  <url>https://languagecloud.sdl.com/lc/api-docs/</url>
  <developers>
    <developer>
      <name>API and Extensibility Team</name>
      <email>api.extensibility.team@rws.com</email>
      <url>https://github.com/RWS/language-cloud-public-api-samples</url>
    </developer>
  </developers>
  <licenses>
    <license>
      <name>MIT License</name>
      <url>http://www.opensource.org/licenses/mit-license.php</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <scm>
    <connection>scm:git:git@github.com:RWS/language-cloud-public-api-samples.git</connection>
    <developerConnection>scm:git:git@github.com:RWS/language-cloud-public-api-samples.git</developerConnection>
    <url>https://github.com/RWS/language-cloud-public-api-samples</url>
  </scm>
  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <excludes>
          <exclude>*.yml</exclude>
          <exclude>java-templates/**</exclude>
          <exclude>scripts/get-openapi.sh</exclude>
        </excludes>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>${exec-maven-plugin.version}</version>
        <executions>
          <execution>
            <id>retrieve-api-doc</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <executable>bash</executable>
              <arguments>
                <argument>${basedir}/src/main/resources/scripts/get-openapi.sh</argument>
              </arguments>
              <skip>${skip.bash.exec}</skip>
            </configuration>
          </execution>
          <execution>
            <id>start-prism-server</id>
            <phase>generate-test-resources</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <executable>bash</executable>
              <arguments>
                <argument>${basedir}/prism.sh</argument>
                <argument>up</argument>
              </arguments>
              <skip>${skip.bash.exec}</skip>
            </configuration>
          </execution>
          <execution>
            <id>stop-prism-server</id>
            <phase>test</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <executable>bash</executable>
              <arguments>
                <argument>${basedir}/prism.sh</argument>
                <argument>halt</argument>
              </arguments>
              <skip>${skip.bash.exec}</skip>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${maven.compiler.plugin.version}</version>
        <configuration>
          <source>${maven.compiler.source}</source>
          <target>${maven.compiler.target}</target>
          <forceJavacCompilerUse>true</forceJavacCompilerUse>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <version>2.3</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.openapitools</groupId>
        <artifactId>openapi-generator-maven-plugin</artifactId>
        <version>${openapi.generator.maven.plugin.version}</version>
        <executions>
          <execution>
            <id>main-spec</id>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <inputSpec>${project.basedir}/src/main/resources/PublicAPI.oas3.yml</inputSpec>
            </configuration>
          </execution>
          <execution>
            <id>webhooks-spec</id>
            <goals>
              <goal>generate</goal>
            </goals>
            <configuration>
              <inputSpec>${project.basedir}/src/main/resources/Webhooks.oas3.yml</inputSpec>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <generatorName>java</generatorName>
          <library>feign</library>
          <configurationFile>${project.basedir}/src/main/resources/gen-config.yml</configurationFile>
          <configOptions>
            <sourceFolder>src/gen/java/main</sourceFolder>
            <interfaceOnly>true</interfaceOnly>
            <dateLibrary>joda</dateLibrary>
          </configOptions>
          <output>${project.build.directory}/generated-sources</output>
          <templateDirectory>src/main/resources/java-templates</templateDirectory>
          <language />
          <modelPackage>com.rws.lt.lc.publicapi.sdk.model</modelPackage>
          <apiPackage>com.rws.lt.lc.publicapi.sdk.api</apiPackage>
          <invokerPackage>com.rws.lt.lc.publicapi.sdk.invoker</invokerPackage>
          <generateApiTests>false</generateApiTests>
          <generateModelTests>false</generateModelTests>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.2.0</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.3.2</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
                <configuration>
                  <source>1.8</source>
                </configuration>
              </execution>
            </executions>
            <configuration>
              <source>1.8</source>
            </configuration>
          </plugin>
          <plugin>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>3.0.1</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.13</version>
            <extensions>true</extensions>
            <executions>
              <execution>
                <id>injected-nexus-deploy</id>
                <phase>deploy</phase>
                <goals>
                  <goal>deploy</goal>
                </goals>
                <configuration>
                  <serverId>ossrh</serverId>
                  <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                  <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
              </execution>
            </executions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <distributionManagement>
        <repository>
          <id>ossrh</id>
          <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
        <snapshotRepository>
          <id>ossrh</id>
          <url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
        </snapshotRepository>
      </distributionManagement>
    </profile>
  </profiles>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>hamcrest-core</artifactId>
          <groupId>org.hamcrest</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.squareup.okhttp3</groupId>
      <artifactId>mockwebserver</artifactId>
      <version>3.6.0</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>okhttp</artifactId>
          <groupId>com.squareup.okhttp3</groupId>
        </exclusion>
        <exclusion>
          <artifactId>bcprov-jdk15on</artifactId>
          <groupId>org.bouncycastle</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <version>1.7.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>3.12.1</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>
  </dependencies>
  <properties>
    <nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>
    <feign-form-version>3.8.0</feign-form-version>
    <java.version>11</java.version>
    <maven.compiler.source>${java.version}</maven.compiler.source>
    <feign-version>11.0</feign-version>
    <jackson-version>2.10.3</jackson-version>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <maven-plugin-version>1.0.0</maven-plugin-version>
    <maven.compiler.target>${java.version}</maven.compiler.target>
    <oltu-version>1.0.1</oltu-version>
    <jackson-databind-version>2.10.3</jackson-databind-version>
    <maven.compiler.plugin.version>3.8.1</maven.compiler.plugin.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <junit-version>4.13</junit-version>
    <jackson-databind-nullable-version>0.2.1</jackson-databind-nullable-version>
    <log4j.version>2.13.2</log4j.version>
    <openapi.generator.maven.plugin.version>4.3.1</openapi.generator.maven.plugin.version>
    <swagger-annotations-version>1.5.24</swagger-annotations-version>
    <exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
    <skip.bash.exec>false</skip.bash.exec>
  </properties>
</project>

