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

<!--
  ~ Copyright (c) 2009-2016 Dmytro Pishchukhin (http://knowhowlab.org)
  ~
  ~ 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/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>org.knowhowlab.osgi</groupId>
    <artifactId>monitoradmin</artifactId>
    <version>1.0.3</version>
    <packaging>bundle</packaging>

    <name>OSGi MonitorAdmin Implementation</name>
    <description>OSGi MonitorAdmin API Implementation</description>

    <url>http://knowhowlab.org</url>

    <developers>
        <developer>
            <name>Dmytro Pishchukhin</name>
            <timezone>GMT+1</timezone>
        </developer>
    </developers>

    <organization>
        <name>Know-How Lab</name>
        <url>http://knowhowlab.org</url>
    </organization>

    <licenses>
        <license>
            <name>Apache License 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0</url>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git@github.com:knowhowlab/org.knowhowlab.osgi.monitoradmin.git</connection>
        <url>scm:git:git@github.com:knowhowlab/org.knowhowlab.osgi.monitoradmin.git</url>
        <developerConnection>scm:git:git@github.com:knowhowlab/org.knowhowlab.osgi.monitoradmin.git</developerConnection>
        <tag>1.0.3</tag>
    </scm>

    <mailingLists>
        <mailingList>
            <name>KnowHowLab OSGi bundles</name>
            <post>knowhowlab-osgi-bundles@googlegroups.com</post>
            <archive>https://groups.google.com/d/forum/knowhowlab-osgi-bundles</archive>
        </mailingList>
    </mailingLists>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <exam.version>3.6.0</exam.version>
        <url.version>1.6.0</url.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.core</artifactId>
            <version>4.2.0</version>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.compendium</artifactId>
            <version>4.2.0</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.6.4</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.osgi</groupId>
            <artifactId>spring-osgi-mock</artifactId>
            <version>1.2.1</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.knowhowlab.osgi</groupId>
            <artifactId>org.knowhowlab.osgi.testing.all</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.exam</groupId>
            <artifactId>pax-exam</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.exam</groupId>
            <artifactId>pax-exam-spi</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.exam</groupId>
            <artifactId>pax-exam-junit4</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.knowhowlab.osgi</groupId>
                <artifactId>org.knowhowlab.osgi.testing.all</artifactId>
                <version>1.3.0</version>
            </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-spi</artifactId>
                <version>${exam.version}</version>
            </dependency>
            <dependency>
                <groupId>org.ops4j.pax.exam</groupId>
                <artifactId>pax-exam-junit4</artifactId>
                <version>${exam.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <executions>
                    <execution>
                        <id>bundle-manifest</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>manifest</goal>
                        </goals>
                    </execution>
                </executions>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Export-Package>org.osgi.service.monitor</Export-Package>
                        <Private-Package>org.knowhowlab.osgi.monitoradmin.*</Private-Package>
                        <Bundle-Activator>org.knowhowlab.osgi.monitoradmin.Activator</Bundle-Activator>
                        <Bundle-SymbolicName>${project.groupId}.${project.artifactId};singleton:=true
                        </Bundle-SymbolicName>
                        <Bundle-RequiredExecutionEnvironment>JavaSE-1.6</Bundle-RequiredExecutionEnvironment>
                        <_removeheaders>
                            Bnd-LastModified, Built-By, Private-Package, Tool, Build-Jdk, Include-Resource
                        </_removeheaders>
                    </instructions>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>**/IT_*.java</exclude>
                    </excludes>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <configuration>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <useReleaseProfile>false</useReleaseProfile>
                    <releaseProfiles>release</releaseProfiles>
                    <goals>deploy</goals>
                </configuration>
            </plugin>

        </plugins>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.5.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>2.6</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <version>2.5.4</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.5.3</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>2.10.3</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>2.4</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>1.6</version>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.18.1</version>
                </plugin>
                <plugin>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>2.18.1</version>
                </plugin>
                <plugin>
                    <groupId>org.eluder.coveralls</groupId>
                    <artifactId>coveralls-maven-plugin</artifactId>
                    <version>3.2.1</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>cobertura-maven-plugin</artifactId>
                    <version>2.7</version>
                    <configuration>
                        <format>xml</format>
                        <maxmem>256m</maxmem>
                        <!-- aggregated reports for multi-module projects -->
                        <aggregate>true</aggregate>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>it</id>

            <dependencies>
                <dependency>
                    <groupId>org.ops4j.pax.exam</groupId>
                    <artifactId>pax-exam-container-forked</artifactId>
                    <version>${exam.version}</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>org.ops4j.pax.exam</groupId>
                    <artifactId>pax-exam-link-mvn</artifactId>
                    <version>${exam.version}</version>
                    <scope>test</scope>
                </dependency>

                <dependency>
                    <groupId>org.ops4j.pax.url</groupId>
                    <artifactId>pax-url-aether</artifactId>
                    <version>${url.version}</version>
                    <scope>test</scope>
                </dependency>

                <dependency>
                    <groupId>ch.qos.logback</groupId>
                    <artifactId>logback-core</artifactId>
                    <version>0.9.29</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>ch.qos.logback</groupId>
                    <artifactId>logback-classic</artifactId>
                    <version>0.9.29</version>
                    <scope>test</scope>
                </dependency>

                <dependency>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>org.apache.felix.main</artifactId>
                    <version>3.0.9</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <includes>
                                <include>**/IT_*.java</include>
                            </includes>
                            <forkMode>pertest</forkMode>
                            <systemProperties>
                                <property>
                                    <name>project.version</name>
                                    <value>${project.version}</value>
                                </property>
                            </systemProperties>
                        </configuration>
                        <executions>
                            <execution>
                                <id>integration-test</id>
                                <goals>
                                    <goal>integration-test</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>verify</id>
                                <goals>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <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>
    </profiles>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>
</project>
