<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2015 Red Hat, Inc. and/or its affiliates.
~
~ Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
-->
<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>

  <parent>
    <groupId>org.wildfly.swarm</groupId>
    <artifactId>parent</artifactId>
    <version>7</version>
    <relativePath />
  </parent>

  <groupId>org.wildfly.swarm</groupId>
  <artifactId>logstash-parent</artifactId>
  <version>1.0.0.Final</version>

  <name>WildFly Swarm: Logstash Parent</name>
  <description>WildFly Swarm: Logstash Parent</description>

  <packaging>pom</packaging>

  <scm>
    <connection>scm:git:git@github.com:wildfly-swarm/wildfly-swarm-logstash.git</connection>
    <developerConnection>scm:git:git@github.com:wildfly-swarm/wildfly-swarm-logstash.git</developerConnection>
    <url>https://github.com/wildfly-swarm/wildfly-swarm-logstash</url>
    <tag>1.0.0.Final</tag>
  </scm>

  <properties>
    <version.swarm.spi>1.0.0.Final</version.swarm.spi>
    <version.swarm.core>1.0.0.CR3</version.swarm.core>
    <version.swarm.fraction-plugin>18</version.swarm.fraction-plugin>
    <version.jboss-logmanager-ext>1.0.0.Alpha3</version.jboss-logmanager-ext>
  </properties>

  <repositories>
    <repository>
      <id>projectodd-snapshots</id>
      <name>Project:odd Snapshots from CI</name>
      <url>https://repository-projectodd.forge.cloudbees.com/snapshot</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.wildfly.swarm</groupId>
          <artifactId>wildfly-swarm-fraction-plugin</artifactId>
          <version>${version.swarm.fraction-plugin}</version>
          <executions>
            <execution>
              <phase>process-classes</phase>
              <goals>
                <goal>process</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <reuseForks>false</reuseForks>
          <runOrder>alphabetical</runOrder>
          <failIfNoTests>false</failIfNoTests>
          <systemPropertyVariables>
            <swarm.bind.address>127.0.0.1</swarm.bind.address>
            <project.version>${project.version}</project.version>
          </systemPropertyVariables>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.wildfly.swarm</groupId>
        <artifactId>spi</artifactId>
        <version>${version.swarm.spi}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <dependency>
        <groupId>org.wildfly.swarm</groupId>
        <artifactId>logstash</artifactId>
        <version>1.0.0.Final</version>
      </dependency>
      <dependency>
        <groupId>org.wildfly.swarm</groupId>
        <artifactId>logstash-api</artifactId>
        <version>1.0.0.Final</version>
      </dependency>
      <dependency>
        <groupId>org.wildfly.swarm</groupId>
        <artifactId>logstash-modules</artifactId>
        <version>1.0.0.Final</version>
      </dependency>
      <dependency>
        <groupId>org.wildfly.swarm</groupId>
        <artifactId>logstash-runtime</artifactId>
        <version>1.0.0.Final</version>
      </dependency>

      <dependency>
        <groupId>org.wildfly.swarm</groupId>
        <artifactId>logging</artifactId>
        <version>${version.swarm.core}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-aether-provider</artifactId>
        <version>3.2.5</version>
      </dependency>

    </dependencies>
  </dependencyManagement>

  <modules>
    <module>logstash</module>

    <module>api</module>
    <module>runtime</module>
    <module>modules</module>
    <module>test</module>
  </modules>

  <profiles>
    <profile>
      <id>attach-exposed-components</id>
      <activation>
        <file>
          <exists>exposed-components.json</exists>
        </file>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>add-exposed-components</id>
                <phase>process-resources</phase>
                <goals>
                  <goal>attach-artifact</goal>
                </goals>
                <configuration>
                  <artifacts>
                    <artifact>
                      <file>exposed-components.json</file>
                      <type>json</type>
                      <classifier>exposed-components</classifier>
                    </artifact>
                  </artifacts>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
