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

  <parent>
    <groupId>org.daisy.pipeline.modules</groupId>
    <artifactId>modules-parent</artifactId>
    <version>1.14.9</version>
  </parent>

  <groupId>ch.sbs.pipeline</groupId>
  <artifactId>modules-parent</artifactId>
  <version>1.9</version>
  <packaging>pom</packaging>

  <name>DAISY Pipeline 2 :: SBS Modules Parent POM</name>
  <description>Parent POM for all Maven based pipeline module projects at SBS</description>
  <url>https://github.com/sbsdev/maven-parents</url>

  <organization>
    <name>Swiss Library for the Blind, Visually Impaired and Print Disabled</name>
    <url>http://www.sbs.ch/</url>
  </organization>

  <licenses>
    <license>
      <name>GNU General Public License, Version 3</name>
      <url>http://www.gnu.org/copyleft/gpl.html</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <id>eglic</id>
      <name>Christian Egli</name>
      <email>christian.egli@sbs.ch</email>
      <organization>Swiss Library for the Blind, Visually Impaired and Print Disabled</organization>
      <organizationUrl>http://www.sbs.ch/</organizationUrl>
      <roles>
        <role>Developer</role>
      </roles>
      <timezone>UTC+01:00</timezone>
    </developer>
    <developer>
      <id>bertfrees</id>
      <name>Bert Frees</name>
      <email>bertfrees@gmail.com</email>
      <organization>Swiss Library for the Blind, Visually Impaired and Print Disabled</organization>
      <organizationUrl>http://www.sbs.ch/</organizationUrl>
      <roles>
        <role>Developer</role>
      </roles>
      <timezone>UTC+01:00</timezone>
    </developer>
  </developers>

  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <name>Sonatype Nexus Snapshots</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
    </snapshotRepository>
    <repository>
      <id>ossrh</id>
      <name>Nexus Release Repository</name>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <scm>
    <connection>scm:git:git://github.com/sbsdev/maven-parents.git</connection>
    <developerConnection>scm:git:ssh://git@github.com:sbsdev/maven-parents.git</developerConnection>
    <tag>v1.9</tag>
    <url>https://github.com/sbsdev/maven-parents/tree/master</url>
  </scm>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.vafer</groupId>
          <artifactId>jdeb</artifactId>
          <version>1.0</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>shell-maven-plugin</artifactId>
          <version>1.0-beta-1</version>
        </plugin>
        <plugin>
          <artifactId>maven-release-plugin</artifactId>
          <version>2.5.1</version>
          <configuration>
            <arguments>-Pattach-sources,attach-javadoc,sign</arguments>
            <mavenExecutorId>forked-path</mavenExecutorId>
            <useReleaseProfile>false</useReleaseProfile>
            <localCheckout>true</localCheckout>
            <pushChanges>false</pushChanges>
            <goals>deploy</goals>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>shell-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>generate-detailed-snapshot-version-filter</id>
            <phase>initialize</phase>
            <goals>
              <goal>shell</goal>
            </goals>
            <configuration>
              <workDir>${project.basedir}</workDir>
              <chmod>true</chmod>
              <script>
                #!/bin/bash
                PROJECT_VERSION=${project.version}
                PROPERTIES_FILE=target/filters/detailed-version.properties
                rm -rf $PROPERTIES_FILE
                mkdir -p $( dirname $PROPERTIES_FILE )
                printf 'project.detailedVersion=' &gt;&gt; $PROPERTIES_FILE
                case $PROJECT_VERSION in
                  *-SNAPSHOT)
                    printf ${PROJECT_VERSION%-SNAPSHOT}~$( date +"%Y%m%d.%H%M%S" )-$( git describe --tags --always --dirty ) &gt;&gt; $PROPERTIES_FILE
                    ;;
                  *)
                    printf $PROJECT_VERSION &gt;&gt; $PROPERTIES_FILE
                    ;;
                esac
                printf '\n' &gt;&gt; $PROPERTIES_FILE
              </script>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>deb</id>
      <activation>
        <file>
          <exists>src/main/deb/DEBIAN/control</exists>
        </file>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-resources-plugin</artifactId>
            <executions>
              <execution>
                <id>filter-deb</id>
                <phase>process-resources</phase>
                <goals>
                  <goal>copy-resources</goal>
                </goals>
                <configuration>
                  <outputDirectory>${project.build.directory}/generated-resources/deb/DEBIAN</outputDirectory>
                  <resources>
                    <resource>
                      <directory>src/main/deb/DEBIAN</directory>
                      <filtering>true</filtering>
                    </resource>
                  </resources>
                  <filters>
                    <filter>${project.build.directory}/filters/detailed-version.properties</filter>
                  </filters>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.vafer</groupId>
            <artifactId>jdeb</artifactId>
            <executions>
              <execution>
                <id>package-deb</id>
                <phase>package</phase>
                <goals>
                  <goal>jdeb</goal>
                </goals>
                <configuration>
                  <controlDir>${project.build.directory}/generated-resources/deb/DEBIAN</controlDir>
                  <classifier>all</classifier>
                  <deb>${project.build.directory}/${project.artifactId}_${project.version}_all.deb</deb>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>sign</id>
      <build>
        <plugins>
          <plugin>
            <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>
    <profile>
      <id>attach-sources</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-source-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>attach-javadoc</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>graph</id>
      <pluginRepositories>
        <pluginRepository>
          <id>mvnplugins.fusesource.org</id>
          <url>http://mvnplugins.fusesource.org/repo/release</url>
          <releases>
            <enabled>true</enabled>
          </releases>
        </pluginRepository>
      </pluginRepositories>
      <build>
        <plugins>
          <plugin>
            <groupId>org.fusesource.mvnplugins</groupId>
            <artifactId>maven-graph-plugin</artifactId>
            <version>1.4</version>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
