<?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">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.opennms.maven.plugins</groupId>
  <artifactId>features-maven-plugin</artifactId>
  <packaging>maven-plugin</packaging>
  <version>1.3.2</version>
  <name>features-maven-plugin Maven Mojo</name>
  <url>http://maven.apache.org</url>

  <prerequisites>
    <maven>3.1.0</maven>
  </prerequisites>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>  
  
  <build>
    <extensions>
      <extension>
        <groupId>org.apache.maven.wagon</groupId>
        <artifactId>wagon-ssh-external</artifactId>
        <version>2.12</version>
      </extension>
    </extensions>

    <resources>
      <resource>
        <directory>src/integration-tests</directory>
        <targetPath>integration-tests</targetPath>
        <filtering>true</filtering>
      </resource>
    </resources>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>2.6</version>
        <configuration>
          <encoding>UTF-8</encoding>
          <escapeString>\</escapeString>
        </configuration>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
        <plugin>
          <groupId>org.eclipse.m2e</groupId>
          <artifactId>lifecycle-mapping</artifactId>
          <version>1.0.0</version>
          <configuration>
            <lifecycleMappingMetadata>
              <pluginExecutions>
                <pluginExecution>
                  <pluginExecutionFilter>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <versionRange>[1.7,)</versionRange>
                    <goals><goal>run</goal></goals>
                  </pluginExecutionFilter>
                  <action><ignore /></action>
                </pluginExecution>
                <pluginExecution>
                	<pluginExecutionFilter>
                		<groupId>org.apache.maven.plugins</groupId>
                		<artifactId>maven-plugin-plugin</artifactId>
                		<versionRange>[3.2,)</versionRange>
                		<goals><goal>descriptor</goal></goals>
                	</pluginExecutionFilter>
                	<action><ignore /></action>
                </pluginExecution>
              </pluginExecutions>
            </lifecycleMappingMetadata>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <profiles>
    <profile>
      <activation>
        <property>
          <name>!skipITs</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-invoker-plugin</artifactId>
            <version>1.8</version>
            <configuration>
              <!-- <debug>true</debug> -->
              <streamLogs>true</streamLogs>
              <addTestClassPath>true</addTestClassPath>
              <projectsDirectory>target/classes/integration-tests</projectsDirectory>
              <localRepositoryPath>target/local-repo</localRepositoryPath>
            </configuration>
            <executions>
              <execution>
                <id>integration-test</id>
                <goals>
                  <goal>install</goal>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <dependencies>
    <dependency>
      <groupId>org.apache.karaf.tooling</groupId>
      <artifactId>karaf-maven-plugin</artifactId>
      <version>3.0.1</version>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.5</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.wagon</groupId>
      <artifactId>wagon-file</artifactId>
      <version>2.12</version>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.wagon</groupId>
      <artifactId>wagon-http</artifactId>
      <version>2.12</version>
    </dependency>
    <!-- override pax-url-aether for some 2.5 bugfixes -->
    <dependency>
      <groupId>org.ops4j.pax.url</groupId>
      <artifactId>pax-url-aether</artifactId>
      <version>2.5.2</version>
    </dependency>

    <!-- make sure karaf-maven-plugin and pax-url-aether match -->
    <dependency>
      <groupId>org.eclipse.aether</groupId>
      <artifactId>aether-api</artifactId>
      <version>1.1.0</version>
    </dependency>
    <dependency>
      <groupId>org.eclipse.aether</groupId>
      <artifactId>aether-connector-basic</artifactId>
      <version>1.1.0</version>
    </dependency>
    <dependency>
      <groupId>org.eclipse.aether</groupId>
      <artifactId>aether-impl</artifactId>
      <version>1.1.0</version>
    </dependency>
    <dependency>
      <groupId>org.eclipse.aether</groupId>
      <artifactId>aether-spi</artifactId>
      <version>1.1.0</version>
    </dependency>
    <dependency>
      <groupId>org.eclipse.aether</groupId>
      <artifactId>aether-transport-wagon</artifactId>
      <version>1.1.0</version>
    </dependency>
    <dependency>
      <groupId>org.eclipse.aether</groupId>
      <artifactId>aether-util</artifactId>
      <version>1.1.0</version>
    </dependency>

    <dependency>
      <groupId>org.apache.maven.plugin-testing</groupId>
      <artifactId>maven-plugin-testing-harness</artifactId>
      <version>3.3.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>xmlunit</groupId>
      <artifactId>xmlunit</artifactId>
      <version>1.6</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  
  <distributionManagement>
    <site>
      <id>opennms-site</id>
      <name>OpenNMS Build Website</name>
      <url>scpexe://repo.opennms.org/var/www/sites/opennms.org/site/repo/sites/opennms/${project.version}/</url>
    </site>
    <repository>
      <id>opennms-repo</id>
      <name>OpenNMS Maven Repository</name>
      <url>scpexe://repo.opennms.org/var/www/sites/opennms.org/site/repo/maven2</url>
    </repository>
    <snapshotRepository>
      <id>opennms-snapshots</id>
      <name>OpenNMS Snapshot Maven Repository</name>
      <url>scpexe://repo.opennms.org/var/www/sites/opennms.org/site/repo/snapshots</url>
    </snapshotRepository>
  </distributionManagement>

  <pluginRepositories>
    <pluginRepository>
      <id>central</id>
      <name>Maven Central</name>
      <url>https://repo1.maven.org/maven2/</url>
    </pluginRepository>
    <pluginRepository>
      <id>opennms-repo</id>
      <name>OpenNMS Repository</name>
      <url>http://maven.opennms.org/content/groups/opennms.org-release</url>
    </pluginRepository>
  </pluginRepositories>

  <repositories>
    <repository>
      <id>central</id>
      <name>Maven Central</name>
      <url>https://repo1.maven.org/maven2/</url>
    </repository>
    <repository>
      <id>eclipse-repository</id>
      <name>Eclipse</name>
      <url>https://repo1.maven.org/maven2/</url>
    </repository>
    <repository>
      <id>maven-restlet</id>
      <name>Restlet</name>
      <url>https://repo.spring.io/plugins-release/</url>
    </repository>
  </repositories>
</project>
