<?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.clarolab.jenkins</groupId>
    <artifactId>jenkins-rest-api-client</artifactId>
    <version>1.1.8</version>
    <packaging>jar</packaging>
    <name>jenkins-rest-api-client</name>
    <description>This library allows to extract information from views, jobs, builds on Jenkins</description>
    <url>https://bitbucket.org/clarolab/jenkins-rest-api-client</url>
    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <scm>
        <url>https://bitbucket.org/clarolab/jenkins-rest-api-client</url>
    </scm>
    <developers>
        <developer>
            <id>rodrigorincon</id>
            <name>Rodrigo Rincon</name>
            <email>rodrigo.rincon@clarolab.com</email>
        </developer>
    </developers>

    <properties>
        <junit.version>5.3.1</junit.version>
        <lombok.version>1.18.8</lombok.version>
        <hamcrest.version>2.1</hamcrest.version>
        <google.guava.version>23.0</google.guava.version>
        <gson.version>2.8.5</gson.version>
        <json.version>20180813</json.version>
        <jenkins.client.version>0.3.8</jenkins.client.version>
        <simple-rest-client.version>1.1</simple-rest-client.version>
        <apache.commons.collections.version>4.4</apache.commons.collections.version>
        <maven-javadoc-plugin.version>3.1.0</maven-javadoc-plugin.version>
        <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
        <maven-source-plugin.version>3.1.0</maven-source-plugin.version>

        <snapshotRepoId>ossrh</snapshotRepoId>
        <snapshotRepoUrl>https://oss.sonatype.org/content/repositories/snapshots</snapshotRepoUrl>
        <releaseRepoId>ossrh</releaseRepoId>
        <releaseRepoUrl>https://oss.sonatype.org/service/local/staging/deploy/maven2</releaseRepoUrl>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-collections4</artifactId>
            <version>${apache.commons.collections.version}</version>
        </dependency>


        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>${lombok.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>${google.guava.version}</version>
        </dependency>

        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>${gson.version}</version>
        </dependency>

        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
            <version>${json.version}</version>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-library</artifactId>
            <version>${hamcrest.version}</version>
        </dependency>

        <dependency>
            <groupId>com.clarolab.http</groupId>
            <artifactId>simple-rest-client</artifactId>
            <version>${simple-rest-client.version}</version>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <!-- Profile shared for releasing to any target server -->
        <!-- To release to central, run: "mvn -Prelease,sign,central-release clean deploy" -->
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <!--For packaging with the source code-->
                    <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>

                    <!--For packaging with the javadoc-->
                    <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>
                </plugins>
            </build>
        </profile>

        <!-- Profile shared for signing artifacts -->
        <profile>
            <id>sign</id>
            <build>
                <plugins>
                    <!--Required to upload to central repository-->
                    <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>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>central-release</id>
            <build>

            </build>
        </profile>

    </profiles>

    <distributionManagement>
        <snapshotRepository>
            <id>${snapshotRepoId}</id>
            <url>${snapshotRepoUrl}</url>
        </snapshotRepository>
        <repository>
            <id>${releaseRepoId}</id>
            <url>${releaseRepoUrl}</url>
        </repository>
    </distributionManagement>

</project>