<?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</groupId>
    <artifactId>daisy</artifactId>
    <version>5</version>
    <relativePath />
  </parent>

  <groupId>org.daisy.pipeline.modules</groupId>
  <artifactId>modules-parent</artifactId>
  <version>1.14.4</version>
  <packaging>pom</packaging>

  <name>DAISY Pipeline 2 :: Modules Parent POM</name>
  <description>The DAISY Pipeline 2 modules provide scripts for automated processing of various digital formats efficiently and economically. It intends to facilitate the production and maintenance of accessible content for people with print disabilities.</description>
  <url>http://www.daisy.org/pipeline2</url>
  <inceptionYear>2010</inceptionYear>
  <organization>
    <name>The DAISY Consortium</name>
    <url>http://www.daisy.org/</url>
  </organization>
  <licenses>
    <license>
      <name>GNU Lesser General Public License, Version 3</name>
      <url>http://www.gnu.org/copyleft/lesser.html</url>
      <distribution>manual</distribution>
    </license>
  </licenses>

  <developers>
    <developer>
      <id>rdeltour</id>
      <name>Romain Deltour</name>
      <email>rdeltour@gmail.com</email>
      <organization>DAISY Consortium</organization>
      <organizationUrl>http://www.daisy.org/</organizationUrl>
      <roles>
        <role>Project Lead</role>
        <role>Developer</role>
      </roles>
      <timezone>UTC+01:00</timezone>
    </developer>
    <developer>
      <id>marisa.demeglio</id>
      <name>Marisa DeMeglio</name>
      <email>marisa.demeglio@gmail.com</email>
      <organization>DAISY Consortium</organization>
      <organizationUrl>http://www.daisy.org/</organizationUrl>
      <roles>
        <role>Developer</role>
      </roles>
      <timezone>UTC-08:00</timezone>
    </developer>
    <developer>
      <id>capitan.cambio</id>
      <name>Javier Asensio Cubero</name>
      <email>capitan.cambio@gmail.com</email>
      <organization>DAISY Consortium</organization>
      <organizationUrl>http://www.daisy.org/</organizationUrl>
      <roles>
        <role>Developer</role>
      </roles>
      <timezone>UTC</timezone>
    </developer>
    <developer>
      <id>josteinaj</id>
      <name>Jostein Austvik Jacobsen</name>
      <email>josteinaj@gmail.com</email>
      <organization>Norwegian Library of Talking Books and Braille</organization>
      <organizationUrl>http://www.nlb.no/</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>SBS - Schweizerische Bibliothek für Blinde, Seh- und Lesebehinderte</organization>
      <organizationUrl>http://sbs.ch/</organizationUrl>
      <roles>
        <role>Developer</role>
      </roles>
      <timezone>UTC+01:00</timezone>
    </developer>
  </developers>

  <mailingLists>
    <mailingList>
      <name>DAISY Pipeline Developers</name>
      <subscribe>http://groups.google.com/group/daisy-pipeline-dev/subscribe</subscribe>
      <unsubscribe>daisy-pipeline-dev+unsubscribe@googlegroups.com</unsubscribe>
      <post>daisy-pipeline-dev@googlegroups.com</post>
      <archive>http://groups.google.com/group/daisy-pipeline-dev</archive>
    </mailingList>
  </mailingLists>

  <issueManagement>
    <system>Google Code Issue Tracker</system>
    <url>http://code.google.com/p/daisy-pipeline/issues/list</url>
  </issueManagement>

  <properties>
    <java.source.version>1.8</java.source.version> <!-- if we change this to 9 we also have to change target to 9 -->
    <java.target.version>1.8</java.target.version>
    <!-- must match version from framework-bom -->
    <saxon.versionRange>[9.8.0,9.8.1)</saxon.versionRange>
  </properties>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>${java.source.version}</source>
          <target>${java.target.version}</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <configuration>
          <tagNameFormat>@{project.artifactId}-@{project.version}</tagNameFormat>
        </configuration>
        <inherited>false</inherited>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <configuration>
            <source>${java.source.version}</source>
            <target>${java.target.version}</target>
            <excludePackageNames>*.impl:*.impl.*</excludePackageNames>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.daisy.pipeline.build</groupId>
          <artifactId>modules-build-helper</artifactId>
          <version>2.7.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jxr-plugin</artifactId>
          <version>2.5</version>
        </plugin>
        <plugin>
          <groupId>org.daisy.pipeline.build</groupId>
          <artifactId>ds-to-spi-maven-plugin</artifactId>
          <version>1.1.2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.felix</groupId>
          <artifactId>maven-bundle-plugin</artifactId>
          <version>4.1.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <!--
              overrides version in daisy-5 (2.19.1) because some tests were crashing with that version
          -->
          <version>2.16</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>2.5.2</version>
          <dependencies>
            <dependency>
              <groupId>org.apache.maven.scm</groupId>
              <artifactId>maven-scm-provider-gitexe</artifactId>
              <version>1.9.1</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>org.daisy.maven</groupId>
          <artifactId>xspec-maven-plugin</artifactId>
          <version>1.0.0</version>
          <dependencies>
            <dependency>
              <groupId>org.daisy.maven</groupId>
              <artifactId>xspec-runner</artifactId>
              <version>1.0.2</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>org.daisy.maven</groupId>
          <artifactId>xproc-maven-plugin</artifactId>
          <version>1.0.2</version>
          <dependencies>
            <!--
                provided dependencies of xprocspec-runner
                
                need to be defined here and not in test dependencies because otherwise the
                Module_xprocspec_runner and MessageStepProvider services will fail to load because
                the XProcStepProvider and Module classes will not be found
            -->
            <dependency>
              <groupId>org.daisy.pipeline</groupId>
              <artifactId>modules-registry</artifactId>
              <version>4.0.1</version>
            </dependency>
            <dependency>
              <groupId>org.daisy.pipeline</groupId>
              <artifactId>xmlcatalog</artifactId>
              <version>2.0.7</version>
            </dependency>
            <dependency>
              <groupId>org.daisy.pipeline</groupId>
              <artifactId>calabash-adapter</artifactId>
              <version>4.4.0</version>
            </dependency>
            <dependency>
              <groupId>org.daisy.libs</groupId>
              <artifactId>com.xmlcalabash</artifactId>
              <version>1.1.20-p8-98</version>
            </dependency>
            <dependency>
              <groupId>org.daisy.xprocspec</groupId>
              <artifactId>xprocspec</artifactId>
              <version>1.4.2</version>
            </dependency>
            <dependency>
              <groupId>org.daisy.pipeline</groupId>
              <artifactId>ds-to-spi-runtime</artifactId>
              <version>1.1.0</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>org.antlr</groupId>
          <artifactId>antlr3-maven-plugin</artifactId>
          <version>3.5.2</version>
        </plugin>
        <plugin>
          <groupId>org.ops4j.pax.exam</groupId>
          <artifactId>maven-paxexam-plugin</artifactId>
          <version>1.2.4</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>exec-maven-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>
        <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
        <plugin>
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <versionRange>[1.7,)</versionRange>
                    <goals>
                      <goal>run</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <execute />
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <versionRange>[2.4,)</versionRange>
                    <goals>
                      <goal>unpack</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <execute />
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <versionRange>[1.0.0,)</versionRange>
                    <goals>
                      <goal>enforce</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-patch-plugin</artifactId>
                    <versionRange>[1.1.1,)</versionRange>
                    <goals>
                      <goal>apply</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <execute />
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.apache.maven.plugins </groupId>
                    <artifactId>maven-scm-plugin</artifactId>
                    <versionRange>[1.8.1,) </versionRange>
                    <goals>
                      <goal>checkout</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <versionRange>[2.5.0,)</versionRange>
                    <goals>
                      <goal>bundle</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.apache.servicemix.tooling</groupId>
                    <artifactId>depends-maven-plugin</artifactId>
                    <versionRange>[1.2,)</versionRange>
                    <goals>
                      <goal>generate-depends-file</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <execute>
                      <runOnIncremental>false</runOnIncremental>
                    </execute>
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.ops4j.pax.exam</groupId>
                    <artifactId>maven-paxexam-plugin</artifactId>
                    <versionRange>[1.2.4,)</versionRange>
                    <goals>
                      <goal>generate-depends-file</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>xml-maven-plugin</artifactId>
                    <versionRange>[1.0,)</versionRange>
                    <goals>
                      <goal>transform</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <execute />
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>shell-maven-plugin
                    </artifactId>
                    <versionRange>[1.0-beta-1,)
                    </versionRange>
                    <goals>
                      <goal>shell</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <ignore />
                  </action>
                </pluginExecution>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.daisy.pipeline.build</groupId>
                    <artifactId>modules-build-helper</artifactId>
                    <versionRange>[2.0.0,)</versionRange>
                    <goals>
                      <goal>process-catalog</goal>
                    </goals>
                  </pluginExecutionFilter>
                  <action>
                    <execute />
                  </action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.daisy.pipeline.modules</groupId>
        <artifactId>modules-bom</artifactId>
        <version>1.14.4</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.daisy.pipeline</groupId>
        <artifactId>framework-bom</artifactId>
        <version>1.14.4</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.daisy.pipeline</groupId>
        <artifactId>ds-to-spi-runtime</artifactId>
        <version>1.1.1</version>
      </dependency>
      <!--
          test dependencies
      -->
      <dependency>
        <groupId>org.daisy.pipeline.modules.braille</groupId>
        <artifactId>obfl-utils</artifactId>
        <version>2.0.1</version>
      </dependency>
      <dependency>
        <groupId>org.daisy.pipeline.build</groupId>
        <artifactId>modules-test-helper</artifactId>
        <version>2.2.1</version>
      </dependency>
      <dependency>
        <groupId>org.daisy.maven</groupId>
        <artifactId>xproc-engine-daisy-pipeline</artifactId>
        <version>1.14.1</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <profiles>
    <profile>
      <id>module-with-catalog</id>
      <activation>
        <file>
          <exists>src/main/resources/META-INF/catalog.xml</exists>
        </file>
      </activation>
      <properties>
        <generated-packages>
          $(if;$(isdir;${project.build.directory}/generated-sources/process-catalog/org/daisy/common/saxon/impl);org.daisy.common.saxon.impl\;-split-package:=first,)
          $(if;$(isdir;${project.build.directory}/generated-sources/process-catalog/org/daisy/common/xpath/saxon/impl);org.daisy.common.xpath.saxon.impl\;-split-package:=first,)
          $(if;$(isdir;${project.build.directory}/generated-sources/process-catalog/org/daisy/common/xproc/calabash/impl);org.daisy.common.xproc.calabash.impl\;-split-package:=first,)
          $(if;$(isdir;${project.build.directory}/generated-sources/process-catalog/org/daisy/pipeline/datatypes/impl);org.daisy.pipeline.datatypes.impl\;-split-package:=first,)
          $(if;$(isdir;${project.build.directory}/generated-sources/process-catalog/org/daisy/pipeline/modules/impl);org.daisy.pipeline.modules.impl\;-split-package:=first,)
          $(if;$(isdir;${project.build.directory}/generated-sources/process-catalog/org/daisy/pipeline/script/impl);org.daisy.pipeline.script.impl\;-split-package:=first,)
          $(if;$(isdir;${project.build.directory}/generated-sources/process-catalog/org/daisy/pipeline/braille/libhyphen/impl);org.daisy.pipeline.braille.libhyphen.impl\;-split-package:=first,)
          $(if;$(isdir;${project.build.directory}/generated-sources/process-catalog/org/daisy/pipeline/braille/liblouis/impl);org.daisy.pipeline.braille.liblouis.impl\;-split-package:=first,)
        </generated-packages>
      </properties>
      <dependencies>
        <dependency>
          <groupId>org.daisy.pipeline</groupId>
          <artifactId>modules-registry</artifactId>
        </dependency>
        <dependency>
          <groupId>org.daisy.pipeline</groupId>
          <artifactId>xmlcatalog</artifactId>
        </dependency>
      </dependencies>
      <build>
        <resources>
          <resource>
            <directory>src/main/resources</directory>
            <excludes>
              <exclude>META-INF/catalog.xml</exclude>
              <exclude>**/*.md</exclude>
            </excludes>
          </resource>
        </resources>
        <plugins>
          <plugin>
            <groupId>org.daisy.pipeline.build</groupId>
            <artifactId>modules-build-helper</artifactId>
            <executions>
              <execution>
                <id>process-catalog</id>
                <phase>generate-sources</phase>
                <goals>
                  <goal>process-catalog</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <configuration>
              <instructions>
                <!--
                    {local-packages} are all the packages with "impl" or "internal"
                    this includes all the ${generated-packages} as well, but ${generated-packages} needs
                    to be declared first so that the "-split-package" directives are taken into account
                -->
                <Private-Package>
                  ${generated-packages}
                  {local-packages}
                </Private-Package>
                <_include>${project.build.directory}/generated-resources/process-catalog/bnd.bnd</_include>
              </instructions>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>module-with-java-services</id>
      <activation>
        <!--
            profile is always active
            if a module has no services, a bit of unnecessary processing is done, but most modules have services
        -->
        <file>
          <exists>src</exists>
        </file>
      </activation>
      <dependencies>
        <dependency>
          <groupId>org.osgi</groupId>
          <artifactId>org.osgi.compendium</artifactId>
          <scope>provided</scope>
        </dependency>
        <dependency>
          <groupId>org.daisy.pipeline</groupId>
          <artifactId>ds-to-spi-runtime</artifactId>
          <scope>provided</scope>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <configuration>
              <instructions>
                <_dsannotations>${expose-services}</_dsannotations>
                <Import-Package>!org.daisy.common.spi,*</Import-Package>
              </instructions>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.daisy.pipeline.build</groupId>
            <artifactId>ds-to-spi-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>generate-spi-classes</id>
                <phase>process-sources</phase>
                <goals>
                  <goal>generate-spi-classes</goal>
                </goals>
                <configuration>
                  <includes>${expose-services}</includes>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>module-with-xspec-tests</id>
      <activation>
        <file>
          <exists>src/test/xspec</exists>
        </file>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.daisy.maven</groupId>
            <artifactId>xspec-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>xspecTest</id>
                <phase>test</phase>
                <goals>
                  <goal>test</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>module-with-java-tests</id>
      <activation>
        <file>
          <exists>src/test/java</exists>
        </file>
      </activation>
      <dependencies>
        <!--
            for MessageStorage, needed by JobMonitorFactory
            FIXME: make optional
        -->
        <dependency>
          <groupId>org.daisy.pipeline</groupId>
          <artifactId>framework-volatile</artifactId>
          <scope>test</scope>
        </dependency>
        <!-- for org.daisy.pipeline.junit.AbstractTest etc. -->
        <dependency>
          <groupId>org.daisy.pipeline.build</groupId>
          <artifactId>modules-test-helper</artifactId>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.ops4j.pax.exam</groupId>
            <artifactId>maven-paxexam-plugin</artifactId>
            <executions>
              <execution>
                <id>generate-depends-file</id>
                <goals>
                  <goal>generate-depends-file</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <executions>
              <execution>
                <id>bundle-before-test</id>
                <phase>generate-test-resources</phase>
                <goals>
                  <goal>bundle</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <systemPropertyVariables>
                <pax.exam.logging>none</pax.exam.logging>
                <!--
                    set this to "PaxExam" to test with OSGi, or to "PaxExam,OSGiLessRunner" to test both
                -->
                <org.daisy.pipeline.junit.runners>OSGiLessRunner</org.daisy.pipeline.junit.runners>
              </systemPropertyVariables>
              <trimStackTrace>false</trimStackTrace>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>module-with-test-logback</id>
      <activation>
        <file>
          <exists>src/test/resources/logback.xml</exists>
        </file>
      </activation>
      <dependencies>
        <!-- for org.daisy.pipeline.logging.JobProgressAppender -->
        <dependency>
          <groupId>org.daisy.pipeline</groupId>
          <artifactId>logging-appender</artifactId>
          <scope>test</scope>
        </dependency>
        <!-- for java.util.logging -->
        <dependency>
          <groupId>org.daisy.pipeline</groupId>
          <artifactId>logging-activator</artifactId>
          <scope>test</scope>
        </dependency>
      </dependencies>
    </profile>

    <profile>
      <id>modules-with-java-test-exclusions</id>
      <activation>
        <file>
          <exists>src/test/java/ignore</exists>
        </file>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <excludesFile>src/test/java/ignore</excludesFile>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>module-with-documentation</id>
      <activation>
        <property>
          <name>documentation</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-resources-plugin</artifactId>
            <executions>
              <execution>
                <id>copy-markdown-and-html</id>
                <phase>prepare-package</phase>
                <goals>
                  <goal>copy-resources</goal>
                </goals>
                <configuration>
                  <!-- to overrule maven.resources.skip if documentation-only is also specified -->
                  <skip>false</skip>
                  <resources>
                    <resource>
                      <directory>${project.basedir}</directory>
                      <includes>
                        <include>index.md</include>
                        <include>src/main/**/*.md</include>
                        <include>doc/**/*</include>
                      </includes>
                    </resource>
                  </resources>
                  <outputDirectory>${project.build.directory}/doc/</outputDirectory>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-jxr-plugin</artifactId>
            <executions>
              <execution>
                <id>htmlize-java</id>
                <phase>prepare-package</phase>
                <goals>
                  <goal>jxr</goal>
                </goals>
                <configuration>
                  <destDir>${project.build.directory}/doc/src/main/java/</destDir>
                  <linkJavadoc>false</linkJavadoc>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.daisy.pipeline.build</groupId>
            <artifactId>modules-build-helper</artifactId>
            <executions>
              <execution>
                <id>xprocdoc</id>
                <phase>prepare-package</phase>
                <goals>
                  <goal>xprocdoc</goal>
                </goals>
                <configuration>
                  <catalogXmlFile>src/main/resources/META-INF/catalog.xml</catalogXmlFile>
                  <catalogXmlBaseURI>http://daisy.github.io/pipeline/modules/${project.artifactId}/src/main/resources/META-INF/catalog.xml</catalogXmlBaseURI>
                  <outputDirectory>${project.build.directory}/xprocdoc</outputDirectory>
                </configuration>
              </execution>
              <execution>
                <id>htmlize-sources</id>
                <phase>prepare-package</phase>
                <goals>
                  <goal>htmlize-sources</goal>
                </goals>
                <configuration>
                  <sourceDirectory>${project.basedir}</sourceDirectory>
                  <outputDirectory>${project.build.directory}/doc</outputDirectory>
                  <catalogXmlFile>${project.basedir}/src/main/resources/META-INF/catalog.xml</catalogXmlFile>
                  <includes>
                    src/main/resources/META-INF/catalog.xml,
                    src/main/resources/**/*.xpl,
                    src/main/resources/**/*.xsl,
                    src/main/resources/**/*.xml,
                    src/main/resources/**/*.rng,
                    src/main/resources/**/*.sch,
                    src/main/resources/**/*.css,
                    src/main/resources/**/*.scss
                  </includes>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-jar-plugin</artifactId>
            <executions>
              <execution>
                <id>package-doc-jar</id>
                <phase>package</phase>
                <goals>
                  <goal>jar</goal>
                </goals>
                <configuration>
                  <classifier>doc</classifier>
                  <classesDirectory>${project.build.directory}/doc</classesDirectory>
                  <includes>
                    <include>**/*.md</include>
                    <include>**/*.html</include>
                    <include>doc/**/*</include>
                    <include>src/main/java/stylesheet.css</include>
                  </includes>
                  <archive>
                    <addMavenDescriptor>false</addMavenDescriptor>
                  </archive>
                </configuration>
              </execution>
              <execution>
                <id>package-xprocdoc-jar</id>
                <phase>package</phase>
                <goals>
                  <goal>jar</goal>
                </goals>
                <configuration>
                  <classifier>xprocdoc</classifier>
                  <classesDirectory>${project.build.directory}/xprocdoc</classesDirectory>
                  <skipIfEmpty>true</skipIfEmpty>
                  <archive>
                    <addMavenDescriptor>false</addMavenDescriptor>
                  </archive>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>module-with-documentation-only</id>
      <activation>
        <property>
          <name>documentation-only</name>
        </property>
      </activation>
      <properties>
        <maven.main.skip>true</maven.main.skip>
        <maven.resources.skip>true</maven.resources.skip>
        <maven.test.skip>true</maven.test.skip>
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <executions>
              <execution>
                <id>default-bundle</id>
                <phase>none</phase>
              </execution>
              <execution>
                <id>default-install</id>
                <phase>none</phase>
              </execution>
              <execution>
                <id>bundle-before-test</id>
                <phase>none</phase>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <!-- only meant to be used for script modules -->
      <id>run-script-webserver</id>
      <dependencies>
        <dependency>
          <groupId>org.daisy.pipeline</groupId>
          <artifactId>webservice</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.daisy.pipeline</groupId>
          <artifactId>persistence-derby</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.daisy.pipeline</groupId>
          <artifactId>calabash-adapter</artifactId>
          <!--
              We set scope to "compile" because "test" or "runtime" would break compilation for some
              modules who actually need it at compile time. FIXME: Replace the XProcStepProvider
              interface from calabash-adapter with a generic Java XProc step API (in a dedicated
              artifact).
          -->
          <scope>compile</scope>
          <!-- <scope>test</scope> -->
        </dependency>
        <!--
            logging will be according to configuration in src/test/resources/logback.xml
        -->
        <dependency>
          <groupId>ch.qos.logback</groupId>
          <artifactId>logback-classic</artifactId>
          <scope>test</scope>
        </dependency>
      </dependencies>
      <properties>
        <skipTests>true</skipTests>
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>run-webserver</id>
                <phase>test</phase>
                <goals>
                  <goal>java</goal>
                </goals>
                <configuration>
                  <includeProjectDependencies>true</includeProjectDependencies>
                  <classpathScope>test</classpathScope>
                  <mainClass>org.daisy.pipeline.webservice.impl.PipelineWebService</mainClass>
                  <systemProperties>
                    <systemProperty>
                      <key>org.daisy.pipeline.data</key>
                      <value>${project.build.directory}/webserver</value>
                    </systemProperty>
                    <systemProperty>
                      <key>org.daisy.pipeline.persistence</key>
                      <value>true</value>
                    </systemProperty>
                    <systemProperty>
                      <key>org.daisy.pipeline.ws.authentication</key>
                      <value>false</value>
                    </systemProperty>
                    <systemProperty>
                      <key>org.daisy.pipeline.ws.localfs</key>
                      <value>true</value>
                    </systemProperty>
                    <systemProperty>
                      <key>org.daisy.pipeline.version</key>
                      <value>SNAPSHOT</value>
                    </systemProperty>
                  </systemProperties>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>test-with-paxexam</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <systemPropertyVariables>
                <org.daisy.pipeline.junit.runners>PaxExam</org.daisy.pipeline.junit.runners>
              </systemPropertyVariables>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <repositories>
    <!-- for javax.persistence -->
    <repository>
      <id>eclipselink</id>
      <name>EclipseLink Releases</name>
      <url>http://download.eclipse.org/rt/eclipselink/maven.repo</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
    <!-- Restlet maven repository -->
    <repository>
      <id>restlet-repo</id>
      <name>Public online Restlet repository</name>
      <url>http://maven.restlet.org</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
  </repositories>

  <scm>
    <tag>v1.14.4</tag>
  </scm>
</project>