<!--
 Copyright 2014 OW2 Chameleon
 Licensed 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>
        <artifactId>parent-pom</artifactId>
        <groupId>org.ow2.chameleon</groupId>
        <version>0.3.2</version>
    </parent>
    <groupId>org.ow2.chameleon.testing</groupId>
    <artifactId>osgi-helpers</artifactId>
    <packaging>bundle</packaging>
    <name>OW2 Chameleon - OSGi Helpers</name>
    <version>0.6.2</version>

    <properties>
        <exam.version>3.0.0</exam.version>
        <disableJavadocLint><!-- only used on jdk8 (see profile) --></disableJavadocLint>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.ipojo</artifactId>
            <version>1.11.1</version>
            <exclusions>
                <exclusion>
                    <groupId>org.osgi</groupId>
                    <artifactId>org.osgi.core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.core</artifactId>
            <version>4.3.1</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.7</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>org.ops4j.pax.exam</groupId>
            <artifactId>pax-exam</artifactId>
            <version>${exam.version}</version>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.exam</groupId>
            <artifactId>pax-exam-junit4</artifactId>
            <version>${exam.version}</version>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.exam</groupId>
            <artifactId>pax-exam-container-native</artifactId>
            <version>${exam.version}</version>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.exam</groupId>
            <artifactId>pax-exam-link-mvn</artifactId>
            <version>${exam.version}</version>
        </dependency>

        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-core</artifactId>
            <version>0.9.6</version>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.5.11</version>
        </dependency>

        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>0.9.6</version>
        </dependency>

        <dependency>
            <groupId>org.ops4j.pax.url</groupId>
            <artifactId>pax-url-wrap</artifactId>
            <version>1.5.2</version>
        </dependency>

        <dependency>
            <groupId>org.ops4j.pax.tinybundles</groupId>
            <artifactId>tinybundles</artifactId>
            <version>1.0.0</version>
        </dependency>

        <!-- The tiny bundle extension must be before the manipulator version
        to use the right version of the manipulator -->
        <dependency>
            <groupId>org.ow2.chameleon.testing</groupId>
            <artifactId>tinybundles-ipojo</artifactId>
            <version>0.3.0</version>
        </dependency>

        <dependency>
            <groupId>org.easytesting</groupId>
            <artifactId>fest-assert</artifactId>
            <version>1.4</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/filtered</directory>
                <filtering>true</filtering>
                <targetPath>${project.build.directory}/filtered</targetPath>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.7</version>
                <executions>
                    <execution>
                        <id>add-source</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>add-source</goal>
                        </goals>
                        <configuration>
                            <sources>
                                <source>${project.build.directory}/filtered</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Export-Package>org.ow2.chameleon.testing.helpers</Export-Package>
                        <Import-Package>
                            !org.ops4j.pax.exam*,
                            !ch.qos.logback*,
                            !org.ops4j.pax.tinybundles*,
                            !org.ow2.chameleon.testing.tinybundles*,
                            org.apache.commons*;resolution:=optional,
                            *
                        </Import-Package>
                        <DynamicImport-Package>
                            *
                        </DynamicImport-Package>
                    </instructions>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                    <skipDeploy>true</skipDeploy>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>net.ju-n.maven.doxia</groupId>
                        <artifactId>doxia-module-markdown</artifactId>
                        <version>1.0.0</version>
                    </dependency>
                    <dependency>
                        <groupId>org.pegdown</groupId>
                        <artifactId>pegdown</artifactId>
                        <version>1.3.0</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <dependencyDetailsEnabled>false</dependencyDetailsEnabled>
                    <dependencyLocationsEnabled>false</dependencyLocationsEnabled>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.9.1</version>
                <configuration>
                    <show>private</show>
                    <additionalparam>${disableJavadocLint}</additionalparam>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>2.5</version>
            </plugin>
        </plugins>
    </reporting>

    <profiles>
        <profile>
            <!-- JDK 8 is a bit picky on the javadoc, this profile disable the linter -->
            <id>jdk8</id>
            <activation>
                <jdk>1.8</jdk>
            </activation>
            <properties>
                <disableJavadocLint>-Xdoclint:none</disableJavadocLint>
            </properties>
        </profile>
    </profiles>

    <scm>
        <connection>scm:git:git@github.com:ow2-chameleon/osgi-testing-helpers.git</connection>
        <url>https://github.com/ow2-chameleon/osgi-testing-helpers</url>
        <developerConnection>scm:git:git@github.com:ow2-chameleon/osgi-testing-helpers.git</developerConnection>
    </scm>
</project>
