<?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/xsd/maven-4.0.0.xsd">
  <parent>
    <artifactId>errai-bus-websocket-parent</artifactId>
    <groupId>org.jboss.errai</groupId>
    <version>4.1.0.Final</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>

  <artifactId>errai-bus-jsr356-websocket-weld</artifactId>
  <name>Errai::Bus::JSR-356::WebSocket::Weld</name>

  <description>JEE 7 / CDI (Weld) extension to the JSR-356 compliant Errai Bus endpoint.</description>

  <properties>
    <wildfly.version>10.0.0.Final</wildfly.version>
    <unpack-as-folder>${project.build.directory}/as-test</unpack-as-folder>
    <test-as-folder>${unpack-as-folder}/wildfly-${wildfly.version}</test-as-folder>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.jboss.errai</groupId>
      <artifactId>errai-bus-jsr356-websocket</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.errai</groupId>
      <artifactId>errai-bus</artifactId>
    </dependency>
    <dependency>
      <groupId>javax.enterprise</groupId>
      <artifactId>cdi-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.spec.javax.servlet</groupId>
      <artifactId>jboss-servlet-api_3.1_spec</artifactId>
      <scope>provided</scope>
    </dependency>

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

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.weld</groupId>
      <artifactId>weld-core</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.jboss.arquillian.junit</groupId>
      <artifactId>arquillian-junit-container</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.shrinkwrap.resolver</groupId>
      <artifactId>shrinkwrap-resolver-depchain</artifactId>
      <type>pom</type>
      <scope>test</scope>
      <!--There is a problem with Aether https://issues.jboss.org/browse/SHRINKRES-174 -->
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-model-builder</artifactId>
      <version>3.1.1</version>
    </dependency>
    <dependency>
      <artifactId>maven-aether-provider</artifactId>
      <groupId>org.apache.maven</groupId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.wildfly.arquillian</groupId>
      <artifactId>wildfly-arquillian-container-embedded</artifactId>
      <version>2.0.0.Final</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.wildfly</groupId>
      <artifactId>wildfly-dist</artifactId>
      <version>${wildfly.version}</version>
      <type>zip</type>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>javax.transaction</groupId>
          <artifactId>jta</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <!--Mismatch of dependencies because of Wildfly -->
      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
        <configuration>
          <skip>true</skip>
        </configuration>
      </plugin>
    </plugins>
    <!--for parametrized arquillian.xml -->
    <testResources>
      <testResource>
        <directory>${project.basedir}/src/test/resources</directory>
        <filtering>true</filtering>
      </testResource>
    </testResources>
  </build>

  <profiles>

    <profile>
      <id>integration-test</id>
      <dependencies>
        <dependency>
          <artifactId>maven-aether-provider</artifactId>
          <groupId>org.apache.maven</groupId>
        </dependency>
        <dependency>
          <groupId>org.jboss.errai</groupId>
          <artifactId>errai-bus</artifactId>
          <exclusions>
            <exclusion>
              <groupId>com.google.guava</groupId>
              <artifactId>guava</artifactId>
            </exclusion>
          </exclusions>
        </dependency>
        <dependency>
          <groupId>com.google.guava</groupId>
          <artifactId>guava</artifactId>
          <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.jboss.logging</groupId>
          <artifactId>jboss-logging</artifactId>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <!-- Override exclusions in parent -->
            <configuration combine.self="override">
              <excludes>
              </excludes>
              <systemPropertyVariables>
                <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
              </systemPropertyVariables>
            </configuration>
          </plugin>

          <plugin>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>
                <id>unpack-wildfly</id>
                <phase>process-resources</phase>
                <goals>
                  <goal>unpack</goal>
                </goals>
                <configuration>
                  <artifactItems>
                    <artifactItem>
                      <groupId>org.wildfly</groupId>
                      <artifactId>wildfly-dist</artifactId>
                      <version>${wildfly.version}</version>
                      <type>zip</type>
                      <outputDirectory>${unpack-as-folder}</outputDirectory>
                    </artifactItem>
                  </artifactItems>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
