<?xml version="1.0" encoding="UTF-8"?>

<!--
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
  distributed with this work for additional information
  regarding copyright ownership.  The ASF licenses this file
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, either express or implied.  See the License for the
  specific language governing permissions and limitations
  under the License.
-->

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

  <parent>
    <groupId>org.apache.tika</groupId>
    <artifactId>tika-parent</artifactId>
    <version>1.2</version>
    <relativePath>../tika-parent/pom.xml</relativePath>
  </parent>

  <artifactId>tika-bundle</artifactId>
  <packaging>bundle</packaging>
  <name>Apache Tika OSGi bundle</name>
  <description>
    OSGi bundle that contains the tika-parsers component and all its
    upstream dependencies that aren't OSGI bundles by themselves. This
    bundle exports no packages, only the Parser and Detector services
    from the tika-parsers component.
  </description>
  <url>http://tika.apache.org/</url>

  <properties>
    <pax.exam.version>2.2.0</pax.exam.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>tika-core</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>tika-parsers</artifactId>
      <version>${project.version}</version>
      <scope>provided</scope>
    </dependency>

    <!-- Test dependencies -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.ops4j.pax.exam</groupId>
      <artifactId>pax-exam-junit4</artifactId>
      <version>${pax.exam.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.ops4j.pax.exam</groupId>
      <artifactId>pax-exam-container-native</artifactId>
      <version>${pax.exam.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.felix</groupId>
      <artifactId>org.apache.felix.framework</artifactId>
      <version>4.0.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.ops4j.pax.exam</groupId>
      <artifactId>pax-exam-link-assembly</artifactId>
      <version>${pax.exam.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.ops4j.pax.url</groupId>
      <artifactId>pax-url-aether</artifactId>
      <version>1.3.3</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <version>1.6.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <extensions>true</extensions>
        <configuration>
          <instructions>
            <Bundle-Activator>
              org.apache.tika.parser.internal.Activator
            </Bundle-Activator>
            <Embed-Dependency>
              tika-parsers;inline=true,
              commons-compress, xz, commons-codec, commons-io,
              pdfbox,fontbox,jempbox,bcmail-jdk15,bcprov-jdk15,
              poi,poi-scratchpad,poi-ooxml,poi-ooxml-schemas,
              xmlbeans, dom4j,
              tagsoup,
              asm,
              juniversalchardet,
              vorbis-java-core, vorbis-java-tika,
              isoparser, aspectjrt,
              metadata-extractor,
              boilerpipe, rome,
              apache-mime4j-core, apache-mime4j-dom
            </Embed-Dependency>
            <Embed-Transitive>true</Embed-Transitive>
            <Bundle-DocURL>${project.url}</Bundle-DocURL>
            <Import-Package>
              org.w3c.dom,
              org.apache.tika.*,
              *;resolution:=optional
            </Import-Package>
            <Export-Package>
              !org.apache.tika.parser,
              !org.apache.tika.parser.external,
              org.apache.tika.parser.*
            </Export-Package>
          </instructions>
        </configuration>
      </plugin>
      <!-- TIKA-763: Workaround to avoid including LGPL classes -->
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <phase>prepare-package</phase>
            <goals>
              <goal>unpack-dependencies</goal>
            </goals>
            <configuration>
              <includeArtifactIds>netcdf</includeArtifactIds>
              <excludes>
                ucar/nc2/iosp/fysat/Fysat*.class,
                ucar/nc2/dataset/transform/VOceanSG1*class,
                ucar/unidata/geoloc/vertical/OceanSG*.class,
                META-INF/**,CHANGES,README
              </excludes>
              <outputDirectory>
                ${project.build.directory}/classes
              </outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>java6</id>
      <activation>
        <jdk>1.6</jdk>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <executions>
              <execution>
                <phase>pre-integration-test</phase>
                <goals>
                  <goal>single</goal>
                </goals>
                <configuration>
                  <descriptor>test-bundles.xml</descriptor>
                  <finalName>test</finalName>
                  <attach>false</attach>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>2.10</version>
            <executions>
              <execution>
                <goals>
                  <goal>integration-test</goal>
                  <goal>verify</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
             <systemPropertyVariables>
               <org.ops4j.pax.logging.DefaultServiceLog.level>
                 WARN
               </org.ops4j.pax.logging.DefaultServiceLog.level>
             </systemPropertyVariables>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
