<?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</groupId>
    <artifactId>framework-parent</artifactId>
    <version>1.13.0</version>
    <relativePath>../parent</relativePath>
  </parent>

  <artifactId>common-utils</artifactId>
  <version>3.1.0</version>

  <packaging>bundle</packaging>
  <name>DAISY Pipeline 2 :: Common Utilities</name>

  <dependencies>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>org.osgi.core</artifactId>
      <scope>provided</scope>
    </dependency>
     <dependency>
      <groupId>org.daisy.libs</groupId>
      <artifactId>saxon-he</artifactId>
    </dependency>
    <dependency>
      <groupId>org.daisy.libs</groupId>
      <artifactId>com.xmlcalabash</artifactId>
    </dependency>
    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>org.osgi.compendium</artifactId>
      <scope>provided</scope>
    </dependency>
    <!--
        runtime dependencies for com.xmlcalabash (OSGi) (FIXME: move to org.daisy.libs:com.xmlcalabash)
    -->
    <dependency>
      <groupId>org.daisy.libs</groupId>
      <artifactId>jing</artifactId>
      <scope>runtime</scope>
      <optional>true</optional>
    </dependency>
    <!--
        test dependencies
    -->
    <dependency>
      <groupId>org.daisy.pipeline</groupId>
      <artifactId>ds-to-spi-runtime</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.carrotsearch</groupId>
      <artifactId>junit-benchmarks</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.powermock</groupId>
      <artifactId>powermock-module-junit4</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.powermock</groupId>
      <artifactId>powermock-api-mockito2</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.daisy.pipeline.build</groupId>
      <artifactId>modules-test-helper</artifactId>
      <version>1.0.4</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>org.daisy.pipeline</groupId>
          <artifactId>saxon-adapter</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-core</artifactId>
      <version>1.3</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.ops4j.pax.exam</groupId>
        <artifactId>maven-paxexam-plugin</artifactId>
        <version>1.2.4</version>
        <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>
        <configuration>
          <instructions>
            <Import-Package>
              net.sf.saxon.*;version="${saxon.versionRange}",
              !org.daisy.common.spi,
              *
            </Import-Package>
            <_dsannotations>
              org.daisy.common.properties.PropertyPublisherFactory,
              org.daisy.common.properties.PropertyTracker
            </_dsannotations>
          </instructions>
        </configuration>
        <executions>
          <execution>
            <id>bundle-before-test</id>
            <phase>generate-test-resources</phase>
            <goals>
              <goal>bundle</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.daisy.pipeline.build</groupId>
        <artifactId>ds-to-spi-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>generate-spi-classes</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>generate-spi-classes</goal>
            </goals>
            <configuration>
              <includes>
                org.daisy.common.properties.PropertyPublisherFactory,
                org.daisy.common.properties.PropertyTracker
              </includes>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <systemPropertyVariables>
            <org.daisy.pipeline.junit.runners>PaxExam,OSGiLessRunner</org.daisy.pipeline.junit.runners>
          </systemPropertyVariables>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.daisy.pipeline.build</groupId>
        <artifactId>modules-build-helper</artifactId>
        <executions>
          <execution>
            <id>package-list</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>dependencies-package-list</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}/dependencies-package-list/</outputDirectory>
              <includes>
                org.daisy.pipeline.*,
                org.daisy.common.*
              </includes>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <offlineLinks>
                <offlineLink>
                  <url>http://daisy.github.io/pipeline/api/</url>
                  <location>${project.build.directory}/dependencies-package-list/</location>
                </offlineLink>
              </offlineLinks>
              <links>
                <link>https://google.github.io/guava/releases/15.0/api/docs</link>
              </links>
              <excludePackageNames>*.impl:*.impl.*</excludePackageNames>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
