<?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/maven-v4_0_0.xsd">
  <parent>
    <groupId>io.hawt</groupId>
    <artifactId>project</artifactId>
    <version>1.4.0.redhat-630395</version>
  </parent>

  <modelVersion>4.0.0</modelVersion>
  <artifactId>hawtio-maven-indexer</artifactId>
  <name>${project.artifactId}</name>
  <description>hawtio :: hawtio-maven-indexer</description>
  <packaging>bundle</packaging>

  <properties>
    <fuse.osgi.export>
    </fuse.osgi.export>
    <fuse.osgi.import>
      !org.apache.avalon.*,
      !org.apache.xerces.*,
      !org.apache.log4j.*,
      *;resolution:=optional
    </fuse.osgi.import>
  </properties>

  <dependencies>
    <!-- logging -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>${slf4j-version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>io.hawt</groupId>
      <artifactId>hawtio-core</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>org.apache.maven.indexer</groupId>
      <artifactId>indexer-core</artifactId>
      <version>5.1.1</version>
    </dependency>
    <dependency>
      <!-- wagon-http-lightweight is not usable in production as it messes with system properties -->
      <groupId>org.apache.maven.wagon</groupId>
      <artifactId>wagon-http</artifactId>
      <version>2.7</version>
    </dependency>

    <!-- Runtime: Plexus IoC compat (is compile since in this example we "boot" plexus) -->
    <!-- Newer releases such as 2.4.3/2.5.1 does not work as it hangs the indexer thread -->
    <dependency>
      <groupId>org.sonatype.sisu</groupId>
      <artifactId>sisu-inject-plexus</artifactId>
      <version>2.3.4</version>
    </dependency>

    <!-- testing -->
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit-version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <version>${slf4j-version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>${log4j-version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven-surefire-plugin-version}</version>
        <configuration>
          <excludes>
            <!-- lets avoid this test as it can be flaky due to the fuse nexus repo -->
            <exclude>**/Fuse*.*</exclude>
            <!-- lets avoid this test by default as it downloads large indices -->
            <exclude>**/MavenIndexFacadeTest.*</exclude>
          </excludes>
          <systemPropertyVariables>
            <basedir>${basedir}</basedir>
          </systemPropertyVariables>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>${maven-bundle-plugin-version}</version>
        <extensions>true</extensions>
        <executions>
          <execution>
            <id>bundle-manifest</id>
            <phase>process-classes</phase>
            <goals>
              <goal>manifest</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <instructions>
            <Embed-Directory>lib</Embed-Directory>
            <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
            <Embed-Transitive>true</Embed-Transitive>
            <Bundle-ClassPath>.</Bundle-ClassPath>
            <Bundle-Name>${project.description}</Bundle-Name>
            <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
            <Import-Package>${fuse.osgi.import}</Import-Package>
            <Export-Package>${fuse.osgi.export}</Export-Package>
            <Implementation-Title>hawtio</Implementation-Title>
            <Implementation-Version>${project.version}</Implementation-Version>
          </instructions>
        </configuration>
      </plugin>

    </plugins>
  </build>

  <profiles>
    <profile>
      <id>itest</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>

      <build>
        <plugins>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>${maven-surefire-plugin-version}</version>
            <configuration>
              <includes>
                <include>**/*Test.*</include>
              </includes>
              <excludes>
              </excludes>
              <systemPropertyVariables>
                <basedir>${basedir}</basedir>
              </systemPropertyVariables>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
