<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~  This file is part of the tock-bot-open-data distribution.
  ~  (https://github.com/voyages-sncf-technologies/tock-bot-open-data)
  ~  Copyright (c) 2017 VSCT.
  ~
  ~  This program is free software: you can redistribute it and/or modify
  ~  it under the terms of the GNU Affero General Public License as published by
  ~  the Free Software Foundation, either version 3 of the License, or
  ~  (at your option) any later version.
  ~
  ~   This program is distributed in the hope that it will be useful,
  ~   but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  ~   GNU Affero General Public License for more details.
  ~
  ~   You should have received a copy of the GNU Affero General Public License
  ~   along with this program.  If not, see <http://www.gnu.org/licenses/>.
  -->

<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>fr.vsct.tock</groupId>
    <artifactId>tock-bot-open-data</artifactId>
    <version>0.1</version>
    <name>Tock Bot Open Data</name>
    <description>A example of bot built with Tock and based on open data APIs</description>
    <url>https://github.com/voyages-sncf-technologies/tock-bot-open-data</url>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
        <testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>

        <kotlin>1.1.1</kotlin>
        <tock>0.1</tock>
        <guava>21.0</guava>

        <junit>4.12</junit>

        <plugin.surefire>2.19.1</plugin.surefire>
        <plugin.source>3.0.1</plugin.source>
        <plugin.release>2.5.3</plugin.release>
        <plugin.gpg>1.6</plugin.gpg>
        <plugin.nexus-staging>1.6.7</plugin.nexus-staging>
        <plugin.dokka.version>0.9.13</plugin.dokka.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>fr.vsct.tock</groupId>
            <artifactId>bot-toolkit</artifactId>
            <version>${tock}</version>
        </dependency>

        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>${guava}</version>
        </dependency>

        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-test-junit</artifactId>
            <version>${kotlin}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <sourceDirectory>${sourceDirectory}</sourceDirectory>
        <testSourceDirectory>${testSourceDirectory}</testSourceDirectory>
        <plugins>
            <plugin>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-maven-plugin</artifactId>
                <version>${kotlin}</version>

                <executions>
                    <execution>
                        <id>compile</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>

                    <execution>
                        <id>test-compile</id>
                        <phase>test-compile</phase>
                        <goals>
                            <goal>test-compile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${plugin.surefire}</version>
                <configuration>
                    <includes>
                        <include>**/*Test.*</include>
                        <include>**/*Spec.*</include>
                        <include>**/*Fix.*</include>
                    </includes>
                    <excludes>
                        <exclude>**/*IntegrationTest.*</exclude>
                    </excludes>

                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${plugin.source}</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>${plugin.release}</version>
                <configuration>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <releaseProfiles>deploy</releaseProfiles>
                    <tagNameFormat>bot-open-data-@{project.version}</tagNameFormat>
                    <preparationGoals>clean package dokka:javadocJar verify</preparationGoals>
                    <goals>package dokka:javadocJar deploy</goals>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>${plugin.nexus-staging}</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>${plugin.gpg}</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jetbrains.dokka</groupId>
                <artifactId>dokka-maven-plugin</artifactId>
                <version>${plugin.dokka.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>dokka</goal>
                            <goal>javadoc</goal>
                            <goal>javadocJar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <repositories>
        <repository>
            <id>maven-snapshots</id>
            <url>http://oss.sonatype.org/content/repositories/snapshots</url>
            <layout>default</layout>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

    <inceptionYear>2017</inceptionYear>
    <organization>
        <name>voyages-sncf-technologies</name>
    </organization>
    <developers>
        <developer>
            <id>jburet_vsct</id>
            <name>Julien Buret</name>
            <email>jburet@voyages-sncf.com</email>
            <organization>voyages-sncf-technologies</organization>
            <organizationUrl>https://www.voyages-sncf.com/</organizationUrl>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>GNU Affero General Public License (AGPL) version 3.0</name>
            <url>https://www.gnu.org/licenses/agpl.txt</url>
            <distribution>repo</distribution>
            <comments/>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git@github.com:voyages-sncf-technologies/tock-bot-open-data.git</connection>
        <developerConnection>scm:git:git@github.com:voyages-sncf-technologies/tock-bot-open-data.git
        </developerConnection>
        <url>git@github.com:voyages-sncf-technologies/tock-bot-open-data.git</url>
        <tag>bot-open-data-0.1</tag>
    </scm>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>
    <pluginRepositories>
        <pluginRepository>
            <id>jcenter</id>
            <name>JCenter</name>
            <url>https://jcenter.bintray.com/</url>
        </pluginRepository>
    </pluginRepositories>

    <profiles>
        <profile>
            <id>build</id>
            <activation>
                <property>
                    <name>!deploy</name>
                </property>
            </activation>
            <properties>
                <gpg.skip>true</gpg.skip>
            </properties>
        </profile>
        <profile>
            <id>deploy</id>
            <activation>
                <property>
                    <name>deploy</name>
                </property>
            </activation>
            <properties>
                <gpg.skip>false</gpg.skip>
            </properties>
        </profile>
    </profiles>

</project>