<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright 2015 Red Hat, Inc. and/or its affiliates
    and other contributors as indicated by the @author tags.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

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

  <name>Hawkular - Accounts - Parent</name>
  <groupId>org.hawkular.accounts</groupId>
  <artifactId>hawkular-accounts-parent</artifactId>
  <version>2.0.2.Final</version>
  <packaging>pom</packaging>

  <parent>
    <groupId>org.hawkular</groupId>
    <artifactId>hawkular-parent</artifactId>
    <version>26</version>
  </parent>

  <modules>
    <module>common</module>
    <module>accounts</module>
    <module>api</module>
    <module>websocket-api</module>
    <module>events-backend</module>
    <module>events-listener</module>
    <module>jaxb-adapters</module>
    <module>keycloak-event-listener-rest</module>
    <module>keycloak-event-listener-jms</module>
    <module>keycloak-theme</module>
    <module>secret-store-api</module>
    <module>secret-store</module>
    <module>undertow-filter</module>
  </modules>

  <inceptionYear>2015</inceptionYear>

  <description>
    Parent module, where the versions are defined.
  </description>

  <developers>
    <developer>
      <id>jpkroehling</id>
      <name>Juraci Paixão Kröhling</name>
      <timezone>+01:00</timezone>
    </developer>
  </developers>

  <scm>
    <url>https://github.com/hawkular/hawkular-accounts</url>
    <connection>scm:git:https://github.com/hawkular/hawkular-accounts</connection>
    <developerConnection>scm:git:git@github.com:hawkular/hawkular-accounts.git</developerConnection>
    <tag>2.0.2.Final</tag>
  </scm>

  <issueManagement>
    <url>https://issues.jboss.org/browse/HAWKULAR</url>
    <system>JIRA</system>
  </issueManagement>

  <ciManagement>
    <system>Travis CI</system>
    <url>https://travis-ci.org/hawkular/hawkular-accounts</url>
  </ciManagement>

  <mailingLists>
    <mailingList>
      <name>Hawkular Developer List</name>
      <subscribe>https://lists.jboss.org/mailman/listinfo/hawkular-dev</subscribe>
      <unsubscribe>https://lists.jboss.org/mailman/listinfo/hawkular-dev</unsubscribe>
      <archive>http://lists.jboss.org/pipermail/hawkular-dev</archive>
    </mailingList>
  </mailingLists>

  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <distributionManagement>
    <repository>
      <id>jboss-releases-repository</id>
      <name>JBoss Releases Repository</name>
      <url>${jboss.releases.repo.url}</url>
    </repository>
    <snapshotRepository>
      <id>jboss-snapshots-repository</id>
      <name>JBoss Snapshots Repository</name>
      <url>${jboss.snapshots.repo.url}</url>
    </snapshotRepository>
  </distributionManagement>

  <properties>
    <version.org.hawkular.commons>0.2.4.Final-SRC-revision-52bafa238d3f27e9c0403d3db9861cccb963d64c</version.org.hawkular.commons>

    <failOnMissingWebXml>false</failOnMissingWebXml>
    <jboss.releases.repo.url>
      https://repository.jboss.org/nexus/service/local/staging/deploy/maven2/
    </jboss.releases.repo.url>
    <jboss.snapshots.repo.url>
      https://repository.jboss.org/nexus/content/repositories/snapshots/
    </jboss.snapshots.repo.url>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.wildfly.bom</groupId>
        <artifactId>wildfly-javaee7</artifactId>
        <version>${version.org.wildfly}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <dependency>
        <groupId>org.wildfly</groupId>
        <artifactId>wildfly-spec-api</artifactId>
        <version>${version.org.wildfly}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.keycloak</groupId>
        <artifactId>keycloak-core</artifactId>
        <version>${version.org.keycloak}</version>
      </dependency>
      <dependency>
        <groupId>org.keycloak</groupId>
        <artifactId>keycloak-adapter-core</artifactId>
        <version>${version.org.keycloak}</version>
      </dependency>
      <dependency>
        <groupId>org.keycloak</groupId>
        <artifactId>keycloak-war-dist-all</artifactId>
        <version>${version.org.keycloak}</version>
        <type>zip</type>
        <exclusions>
          <exclusion>
            <groupId>org.keycloak</groupId>
            <artifactId>keycloak-tomcat7-adapter-dist</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.keycloak</groupId>
            <artifactId>keycloak-example-themes-dist</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.keycloak</groupId>
            <artifactId>keycloak-eap6-adapter-dist</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.keycloak</groupId>
            <artifactId>keycloak-wildfly-adapter-dist</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.keycloak</groupId>
            <artifactId>keycloak-as7-adapter-dist</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.keycloak</groupId>
        <artifactId>keycloak-wildfly-adapter-dist</artifactId>
        <version>${version.org.keycloak}</version>
        <type>zip</type>
        <exclusions>
          <exclusion>
            <groupId>org.keycloak</groupId>
            <artifactId>keycloak-undertow-adapter</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.liquibase</groupId>
        <artifactId>liquibase-core</artifactId>
        <version>3.3.3</version>
      </dependency>
      <dependency>
        <groupId>com.mattbertolini</groupId>
        <artifactId>liquibase-slf4j</artifactId>
        <version>1.2.1</version>
      </dependency>

      <dependency>
        <groupId>com.h2database</groupId>
        <artifactId>h2</artifactId>
        <scope>test</scope>
        <version>1.4.185</version>
      </dependency>

      <dependency>
        <groupId>org.jboss.spec.javax.websocket</groupId>
        <artifactId>jboss-websocket-api_1.1_spec</artifactId>
        <version>1.1.1.Final</version>
      </dependency>

      <dependency>
        <groupId>org.jboss.spec.javax.json</groupId>
        <artifactId>jboss-json-api_1.0_spec</artifactId>
        <version>1.0.0.Final</version>
      </dependency>

      <dependency>
        <groupId>org.hawkular.commons</groupId>
        <artifactId>hawkular-commons-email</artifactId>
        <version>${version.org.hawkular.commons}</version>
      </dependency>

      <dependency>
        <groupId>org.hawkular.commons</groupId>
        <artifactId>hawkular-commons-embedded-cassandra-ear</artifactId>
        <version>${version.org.hawkular.commons}</version>
        <type>ear</type>
      </dependency>

      <dependency>
        <groupId>org.cassandraunit</groupId>
        <artifactId>cassandra-unit</artifactId>
        <version>2.2.2.0-SRC-revision-fa3000df77b3118cfbca9f2ee9d0ec06b2ceec90</version>
        <scope>test</scope>
        <exclusions>
          <exclusion>
            <groupId>org.apache.cassandra</groupId>
            <artifactId>cassandra-all</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.hectorclient</groupId>
            <artifactId>hector-core</artifactId>
          </exclusion>
          <exclusion>
            <groupId>com.datastax.cassandra</groupId>
            <artifactId>cassandra-driver-core</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <profiles>
    <profile>
      <id>distribution</id>
      <modules>
        <module>dist</module>
      </modules>
    </profile>
    <profile>
      <id>sample</id>
      <modules>
        <module>sample</module>
        <module>sample-websocket-secured</module>
        <module>sample-websocket-backend</module>
        <module>sample-websocket-frontend</module>
      </modules>
    </profile>
    <profile>
      <id>itest</id>
      <modules>
        <module>dist</module>
        <module>integration-tests</module>
      </modules>
    </profile>
  </profiles>

  <build>
    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
        <filtering>true</filtering>
      </testResource>
    </testResources>
    <plugins>
      <plugin>
        <groupId>org.codehaus.gmaven</groupId>
        <artifactId>groovy-maven-plugin</artifactId>
        <version>2.0</version>
        <executions>
          <execution>
            <id>set-custom-property</id>
            <phase>initialize</phase>
            <goals>
              <goal>execute</goal>
            </goals>
            <configuration>
              <source>
                import java.util.UUID
                def uuidBackend = UUID.randomUUID().toString()
                def uuidUi = UUID.randomUUID().toString()
                project.properties.setProperty('uuid.hawkular.accounts.backend', uuidBackend.toString())
                project.properties.setProperty('uuid.hawkular.ui', uuidUi.toString())
                project.properties.setProperty('uuid.hawkular.secretstore', uuidUi.toString())
              </source>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <configuration>
          <webResources>
            <resource>
              <filtering>true</filtering>
              <directory>src/main/webapp</directory>
              <includes>
                <include>**/web.xml</include>
              </includes>
            </resource>
          </webResources>
          <warSourceDirectory>src/main/webapp</warSourceDirectory>
          <webXml>src/main/webapp/WEB-INF/web.xml</webXml>
          <failOnMissingWebXml>${failOnMissingWebXml}</failOnMissingWebXml>
        </configuration>
      </plugin>

    </plugins>
  </build>
</project>
