<?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">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.languageweaver.sdk</groupId>
    <artifactId>lw-sdk-pom</artifactId>
    <packaging>pom</packaging>
    <version>3.1.1</version>
    <modules>
        <module>common</module>
        <module>translation</module>
    </modules>

    <properties>
        <junit.platform.version>1.1.0-RC1</junit.platform.version>
        <spring-web.version>5.3.23</spring-web.version>
        <maven-compiler-plugin.version>3.3</maven-compiler-plugin.version>
        <compile.java.version>1.8</compile.java.version>
        <logback.version>1.2.10</logback.version>
        <gson.version>2.9.0</gson.version>
        <commons-io.version>2.11.0</commons-io.version>
        <httpcomponents.version>4.5.13</httpcomponents.version>
        <maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
        <maven-shade-plugin.version>3.2.1</maven-shade-plugin.version>
        <maven-nexus-staging-plugin.version>1.6.7</maven-nexus-staging-plugin.version>
        <maven-source-plugin.version>2.2.1</maven-source-plugin.version>
        <maven-javadoc-plugin.version>2.9.1</maven-javadoc-plugin.version>
        <maven-gpg-plugin.version>1.5</maven-gpg-plugin.version>
        <json-version>20211205</json-version>
        <sdk-url>https://mt-sdk-resources.s3.eu-central-1.amazonaws.com/lw-sdk-2.0.jar</sdk-url>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
                <configuration>
                    <source>${compile.java.version}</source>
                    <target>${compile.java.version}</target>
                </configuration>
            </plugin>
            <!-- disable upload artifacts to nexus -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>${maven-deploy-plugin.version}</version>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>${maven-nexus-staging-plugin.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <name>Java SDK for Language Weaver Machine Translation</name>
    <description>The Language Weaver Machine Translation SDK for Java provides APIs for translations on Language Weaver - Cloud and Edge.</description>
    <url>${sdk-url}</url>

    <licenses>
        <license>
            <name>The Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Language Weaver</name>
            <email>contact@languageweaver.com</email>
            <organization>RWS</organization>
        </developer>
    </developers>

    <scm>
        <connection>scm:hg:${sdk-url}</connection>
        <developerConnection>scm:hg:${sdk-url}</developerConnection>
        <url>${sdk-url}</url>
    </scm>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <!-- disable upload artifacts to nexus -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-deploy-plugin</artifactId>
                        <version>${maven-deploy-plugin.version}</version>
                        <configuration>
                            <skip>true</skip>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${maven-source-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${maven-javadoc-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven-gpg-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <keyname>${gpg.keyname}</keyname>
                                    <passphrase>${gpg.passphrase}</passphrase>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
            <distributionManagement>
                <snapshotRepository>
                    <id>ossrh</id>
                    <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
                </snapshotRepository>
                <repository>
                    <id>ossrh</id>
                    <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
                </repository>
            </distributionManagement>
        </profile>
    </profiles>

    <distributionManagement>
        <repository>
            <id>deployment</id>
            <name>Internal Releases</name>
            <url>http://nexus.ad.ai.sdl.com:8081/repository/maven-releases</url>
        </repository>
        <snapshotRepository>
            <id>deployment</id>
            <name>Internal Snapshots</name>
            <url>http://nexus.ad.ai.sdl.com:8081/repository/maven-snapshots</url>
        </snapshotRepository>
    </distributionManagement>

</project>