<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2009-2013 Roland Huss
  ~
  ~ 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>

  <artifactId>jolokia-service-discovery</artifactId>
  <version>2.4.3</version>
  <packaging>bundle</packaging>

  <name>jolokia-service-discovery</name>
  <description>Jolokia :: Service :: Agent Discovery</description>

  <parent>
    <groupId>org.jolokia</groupId>
    <artifactId>jolokia-parent</artifactId>
    <version>2.4.3</version>
    <relativePath>../../pom.xml</relativePath>
  </parent>

  <url>https://jolokia.org/</url>

  <dependencies>

    <!-- Jolokia own artifacts -->

    <dependency>
      <groupId>org.jolokia</groupId>
      <artifactId>jolokia-server-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jolokia</groupId>
      <artifactId>jolokia-server-core</artifactId>
      <classifier>tests</classifier>
      <scope>test</scope>
    </dependency>

    <!-- OSGi dependencies -->

    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>osgi.core</artifactId>
      <scope>provided</scope>
    </dependency>

    <!-- Other dependencies -->

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <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.jolokia.service.discovery.osgi.DiscoveryServiceActivator</Bundle-Activator>
            <Bundle-SymbolicName>org.jolokia.service.discovery</Bundle-SymbolicName>
            <Bundle-Description>Jolokia auto discovery</Bundle-Description>
            <Import-Package>
              <!-- JDK -->
              javax.management,
              <!-- jolokia-json -->
              org.jolokia.json;version="[2.2,3)",
              org.jolokia.json.parser;version="[2.2,3)",
              <!-- jolokia-server-core -->
              org.jolokia.server.core.config;version="[2.2,3)",
              org.jolokia.server.core.service.api;version="[2.2,3)",
              org.jolokia.server.core.util;version="[2.2,3)",
              <!-- OSGi Core -->
              org.osgi.framework;version="[1.8,2)"
            </Import-Package>
            <Export-Package>
              org.jolokia.service.discovery,
              org.jolokia.service.discovery.osgi
            </Export-Package>
          </instructions>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <systemPropertyVariables>
            <project.version>${project.version}</project.version>
          </systemPropertyVariables>
        </configuration>
        <executions>
          <execution>
            <id>default-test</id>
            <goals>
              <goal>test</goal>
            </goals>
            <phase>test</phase>
            <configuration>
              <argLine>
                -Djava.net.preferIPv4Stack=false
              </argLine>
            </configuration>
          </execution>
          <execution>
            <id>default-test-ip4-only</id>
            <goals>
              <goal>test</goal>
            </goals>
            <phase>test</phase>
            <configuration>
              <argLine>
                -Djava.net.preferIPv4Stack=true
              </argLine>
            </configuration>
          </execution>
          <execution>
            <id>default-test-ip6-preferred</id>
            <goals>
              <goal>test</goal>
            </goals>
            <phase>test</phase>
            <configuration>
              <argLine>
                -Djava.net.preferIPv6Addresses=true
              </argLine>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <reportSets>
          <reportSet>
            <reports>
              <report>dependencies</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
    </plugins>
  </reporting>

</project>
