<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         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>1.0.0.Alpha6</version>
  </parent>

  <groupId>org.wildfly.swarm.servers</groupId>
  <artifactId>servers-parent</artifactId>

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

  <packaging>pom</packaging>

  <properties>
    <version.wildfly-swarm>${project.version}</version.wildfly-swarm>

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

    <maven.compiler.target>1.8</maven.compiler.target>
    <maven.compiler.source>1.8</maven.compiler.source>

    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

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

  <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>
  <pluginRepositories>
    <pluginRepository>
      <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>
    </pluginRepository>
  </pluginRepositories>

  <build>
    <finalName>${project.artifactId}</finalName>

    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.wildfly.swarm</groupId>
          <artifactId>wildfly-swarm-plugin</artifactId>
          <version>${version.wildfly-swarm}</version>
          <executions>
            <execution>
              <id>package</id>
              <goals>
                <goal>package</goal>
              </goals>
            </execution>
            <execution>
              <id>start</id>
              <phase>pre-integration-test</phase>
              <goals>
                <goal>start</goal>
              </goals>
              <configuration>
                <stdoutFile>target/stdout.log</stdoutFile>
                <stderrFile>target/stderr.log</stderrFile>
              </configuration>
            </execution>
            <execution>
              <id>stop</id>
              <phase>post-integration-test</phase>
              <goals>
                <goal>stop</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-failsafe-plugin</artifactId>
        <executions>
          <execution>
            <id>integration-test</id>
            <goals>
              <goal>integration-test</goal>
            </goals>
            <configuration>
              <testSourceDirectory>src/it/java</testSourceDirectory>
            </configuration>
          </execution>
          <execution>
            <id>verify</id>
            <goals>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
      </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>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>org.wildfly.swarm</groupId>
      <artifactId>arquillian</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.arquillian.junit</groupId>
      <artifactId>arquillian-junit-container</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.arquillian.graphene</groupId>
      <artifactId>graphene-webdriver</artifactId>
      <type>pom</type>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <modules>
    <module>hawkular</module>
    <module>keycloak</module>
  </modules>

  <profiles>
    <profile>
      <id>uberjar</id>
      <properties>
        <wildfly-swarm.useUberJar>true</wildfly-swarm.useUberJar>
      </properties>
    </profile>
    <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>
  </profiles>
</project>
