<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2016 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>build-bom</artifactId>
    <version>1.0.0.Alpha6</version>
    <relativePath>build/bom/</relativePath>
  </parent>

  <groupId>org.wildfly.swarm</groupId>
  <artifactId>parent</artifactId>
  <version>1.0.0.Alpha6</version>

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

  <packaging>pom</packaging>

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

  <licenses>
    <license>
      <name>AL2</name>
    </license>
  </licenses>

  <properties>
    <version.wildfly.swarm.fraction.plugin>1.0.0.Alpha8</version.wildfly.swarm.fraction.plugin>

    <version.jruby-maven-plugin>1.1.3</version.jruby-maven-plugin>
    <version.maven-plugin-plugin>3.4</version.maven-plugin-plugin>
    <version.maven-archetype-plugin>2.2</version.maven-archetype-plugin>
    <version.maven-shade-plugin>2.4.1</version.maven-shade-plugin>
    <version.maven-exec-plugin>1.2.1</version.maven-exec-plugin>
    <version.build-helper-maven-plugin>1.9.1</version.build-helper-maven-plugin>
    <version.maven.plugin.api>3.2.5</version.maven.plugin.api>

    <maven.min.version>3.2.1</maven.min.version>

    <!-- Surefire args -->
    <surefire.jpda.args />
    <surefire.system.args>-da ${surefire.jpda.args}</surefire.system.args>

    <!-- Checkstyle configuration -->
    <linkXRef>false</linkXRef>

    <!-- maven-compiler-plugin -->
    <maven.compiler.target>1.8</maven.compiler.target>
    <maven.compiler.source>1.8</maven.compiler.source>
  </properties>

  <build>
    <extensions>
      <extension>
        <groupId>org.apache.maven.wagon</groupId>
        <artifactId>wagon-webdav-jackrabbit</artifactId>
        <version>2.10</version>
      </extension>
    </extensions>
    <plugins>
      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <phase>generate-sources</phase>
            <goals>
              <goal>tree</goal>
            </goals>
            <configuration>
              <outputFile>target/dependencies.info</outputFile>
              <tokens>whitespace</tokens>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <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>
      <plugin>
        <artifactId>maven-release-plugin</artifactId>
        <configuration>
          <autoVersionSubmodules>true</autoVersionSubmodules>
          <tagNameFormat>@{project.version}</tagNameFormat>
          <pushChanges>false</pushChanges>
          <scmCommentPrefix>[RELEASE] </scmCommentPrefix>
          <preparationGoals>clean install</preparationGoals>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>add-test-source</id>
            <phase>generate-test-sources</phase>
            <goals>
              <goal>add-test-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>src/it/java</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-failsafe-plugin</artifactId>
        <executions>
          <execution>
            <id>integration-test</id>
            <phase>integration-test</phase>
            <goals>
              <goal>integration-test</goal>
            </goals>
            <configuration>
              <testSourceDirectory>src/it/java</testSourceDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>de.saumya.mojo</groupId>
          <artifactId>jruby-maven-plugin</artifactId>
          <version>${version.jruby-maven-plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-plugin-plugin</artifactId>
          <version>${version.maven-plugin-plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-archetype-plugin</artifactId>
          <version>${version.maven-archetype-plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-shade-plugin</artifactId>
          <version>${version.maven-shade-plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-exec-plugin</artifactId>
          <version>${version.maven-exec-plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>${version.build-helper-maven-plugin}</version>
        </plugin>
        <plugin>
          <artifactId>maven-javadoc-plugin</artifactId>
          <configuration>
            <failOnError>false</failOnError>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-jar-plugin</artifactId>
        </plugin>
        <plugin>
          <groupId>org.wildfly.swarm</groupId>
          <artifactId>wildfly-swarm-fraction-plugin</artifactId>
          <version>${version.wildfly.swarm.fraction.plugin}</version>
          <executions>
            <execution>
              <phase>prepare-package</phase>
              <goals>
                <goal>generate</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.easytesting</groupId>
      <artifactId>fest-assert</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <repositories>
    <repository>
      <id>jboss-public-repository-group</id>
      <name>JBoss Public Repository Group</name>
      <url>http://repository.jboss.org/nexus/content/groups/public/</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </repository>
  </repositories>

  <pluginRepositories>
    <pluginRepository>
      <id>jboss-public-repository-group</id>
      <name>JBoss Public Repository Group</name>
      <url>http://repository.jboss.org/nexus/content/groups/public/</url>
      <releases>
        <enabled>true</enabled>
      </releases>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
    </pluginRepository>
  </pluginRepositories>

  <modules>
    <module>bom</module>
    <module>build/bom</module>

    <!-- misc -->
    <module>fraction-list</module>
    <module>archetype</module>
    <module>tools</module>
    <module>plugin</module>
    <module>arquillian</module>
    <module>swarmtool</module>

    <!-- base -->
    <module>bootstrap</module>
    <module>container</module>

    <module>management</module>

    <!-- fractions -->
    <module>batch-jberet</module>
    <module>bean-validation</module>
    <module>connector</module>
    <module>datasources</module>
    <module>ee</module>
    <module>ejb</module>
    <module>ejb-remote</module>
    <module>hawkular</module>
    <module>hawkular-server</module>
    <module>hibernate-validator</module>
    <module>infinispan</module>
    <module>io</module>
    <module>jackson</module>
    <module>jaxrs</module>
    <module>jaxrs-jaxb</module>
    <module>jaxrs-jsonp</module>
    <module>jaxrs-multipart</module>
    <module>jaxrs-weld</module>
    <module>jca</module>
    <module>jgroups</module>
    <module>jolokia</module>
    <module>jmx</module>
    <module>jpa</module>
    <module>jsf</module>
    <module>keycloak</module>
    <module>keycloak-server</module>
    <module>logging</module>
    <module>logstash</module>
    <module>mail</module>
    <module>messaging</module>
    <module>msc</module>
    <module>naming</module>
    <module>remoting</module>
    <module>ribbon</module>
    <module>ribbon-secured</module>
    <module>ribbon-webapp</module>
    <module>security</module>
    <module>swagger</module>
    <module>transactions</module>
    <module>undertow</module>
    <module>undertow-js</module>
    <module>weld</module>
    <module>webservices</module>

    <module>archaius</module>
    <module>guava</module>
    <module>hystrix</module>
    <module>rxjava</module>
    <module>rxnetty</module>
    <module>servo</module>

    <module>integration-tests</module>
  </modules>

  <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>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <phase>package</phase>
                <goals>
                  <goal>jar</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>
    <profile>
      <id>license</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.mycila</groupId>
            <artifactId>license-maven-plugin</artifactId>
            <configuration>
              <header>./support/license-header.txt</header>
              <includes>
                <include>**/*.java</include>
              </includes>
            </configuration>
            <executions>
              <execution>
                <phase>verify</phase>
                <goals>
                  <goal>format</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
