<?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>cz.abclinuxu.datoveschranky</groupId>
  <artifactId>java-isds</artifactId>
  <packaging>pom</packaging>
  <version>1.0.0.Alpha</version>

  <name>JavaISDS</name>
  <description>JavaISDS build POM</description>
  <url>https://github.com/czgov/java-isds</url>

  <properties>
    <!-- maven project settings -->
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>1.5</maven.compiler.source>
    <maven.compiler.target>1.5</maven.compiler.target>
  </properties>

  <licenses>
    <license>
      <name>BSD 3-Clause License</name>
      <url>https://raw.githubusercontent.com/czgov/java-isds/master/license.txt</url>
    </license>
  </licenses>

  <scm>
    <url>https://github.com/czgov/java-isds</url>
    <connection>scm:git:git://github.com/czgov/java-isds.git</connection>
    <developerConnection>scm:git:git@github.com:czgov/java-isds.git</developerConnection>
  </scm>

  <developers>
    <developer>
      <name>Vaclav Rosecky</name>
    </developer>
    <developer>
      <name>Josef Ludvicek</name>
    </developer>
  </developers>

  <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>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <modules>
    <module>isds-common</module>
    <module>tiny-isds</module>
    <module>isds-web-services</module>
    <module>isds</module>
    <module>message-viewer</module>
    <module>examples</module>
  </modules>

  <build>
    <plugins>
      <plugin>
        <!-- generate javadoc -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
          <author>true</author>
          <defaultAuthor>Vaclav Rosecky</defaultAuthor>
          <!-- current JavaDocs produce lot of warnings and fail the build on Java8 -->
          <additionalparam>-Xdoclint:none</additionalparam>
        </configuration>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <!-- generate source jar -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.2.1</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <!-- sign artifacts when releasing -->
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
