<?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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <name>Errai::CDI::Weld Integration</name>
  <artifactId>errai-weld-integration</artifactId>
  <packaging>jar</packaging>

  <!-- Parent -->
  <parent>
    <groupId>org.jboss.errai</groupId>
    <artifactId>cdi-integration-parent</artifactId>
    <version>3.1.1.Final</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <build>
    <testOutputDirectory>war/WEB-INF/classes/</testOutputDirectory>
    <resources>
      <resource>
        <directory>src/main/java</directory>
      </resource>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>src/test/java</directory>
      </testResource>
      <testResource>
        <directory>src/test/resources</directory>
      </testResource>
    </testResources>
  </build>

  <profiles>
    <profile>
      <id>default</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <properties>
        <profile.testOutputDirectory>target/test-classes</profile.testOutputDirectory>
      </properties>

      <dependencies>
        <!-- Errai Core -->
        <dependency>
          <groupId>org.jboss.errai</groupId>
          <artifactId>errai-common</artifactId>
        </dependency>

        <dependency>
          <groupId>org.jboss.errai</groupId>
          <artifactId>errai-bus</artifactId>
        </dependency>

        <dependency>
          <groupId>org.jboss.errai</groupId>
          <artifactId>errai-bus</artifactId>
          <type>test-jar</type>
          <scope>test</scope>
        </dependency>

        <dependency>
          <groupId>org.jboss.errai</groupId>
          <artifactId>errai-config</artifactId>
        </dependency>

        <dependency>
          <groupId>org.jboss.errai</groupId>
          <artifactId>errai-ioc</artifactId>
          <scope>provided</scope>
        </dependency>

        <dependency>
          <groupId>org.jboss.errai</groupId>
          <artifactId>errai-ioc</artifactId>
          <type>test-jar</type>
          <scope>test</scope>
        </dependency>

        <dependency>
          <groupId>org.jboss.errai</groupId>
          <artifactId>errai-ioc-bus-support</artifactId>
          <scope>provided</scope>
        </dependency>

        <dependency>
          <groupId>javax.enterprise</groupId>
          <artifactId>cdi-api</artifactId>
          <scope>provided</scope>
        </dependency>

        <dependency>
          <groupId>org.jboss.errai</groupId>
          <artifactId>errai-cdi-client</artifactId>
          <scope>compile</scope>
        </dependency>

        <dependency>
          <groupId>org.jboss.errai</groupId>
          <artifactId>errai-cdi-client</artifactId>
          <type>test-jar</type>
          <scope>test</scope>
        </dependency>

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

        <!-- GWT -->
        <!-- Must come after errai-common is inherited for patched JUnitShell -->
        <dependency>
          <groupId>com.google.gwt</groupId>
          <artifactId>gwt-user</artifactId>
          <scope>provided</scope>
        </dependency>

        <dependency>
          <groupId>com.google.gwt</groupId>
          <artifactId>gwt-dev</artifactId>
          <scope>provided</scope>
        </dependency>

        <dependency>
          <groupId>javax.validation</groupId>
          <artifactId>validation-api</artifactId>
          <scope>provided</scope>
        </dependency>

        <dependency>
          <groupId>javax.validation</groupId>
          <artifactId>validation-api</artifactId>
          <classifier>sources</classifier>
          <scope>provided</scope>
        </dependency>

        <dependency>
          <groupId>org.jboss.spec.javax.ejb</groupId>
          <artifactId>jboss-ejb-api_3.1_spec</artifactId>
          <scope>provided</scope>
        </dependency>

        <dependency>
          <groupId>org.quartz-scheduler</groupId>
          <artifactId>quartz</artifactId>
          <scope>provided</scope>
        </dependency>

        <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <scope>provided</scope>
        </dependency>

        <dependency>
          <!-- After the CDI project merge-into-parent, the JBossJNDI class 
            in this project wouldn't compile in Eclipse anymore. This dependency fixes 
            the compile error without changing the semantics of the build result. However, 
            we don't know if webapps have access to this library or not in AS7. On further 
            testing, we may find that it's necessary to scope this as compile rather 
            than provided. -->
          <groupId>org.jboss</groupId>
          <artifactId>jboss-common-core</artifactId>
          <scope>provided</scope>
        </dependency>

        <dependency>
          <groupId>org.jboss.errai</groupId>
          <artifactId>errai-javax-enterprise</artifactId>
          <scope>provided</scope>
        </dependency>

        <dependency>
          <groupId>org.jboss.errai</groupId>
          <artifactId>errai-data-binding</artifactId>
          <scope>provided</scope>
        </dependency>
      </dependencies>

      <build>
        <plugins>
          <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
              <excludes>
                <exclude>com/google/gwt/junit/JUnitShell.java</exclude>
              </excludes>
            </configuration>
          </plugin>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <skipTests>true</skipTests>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>integration-test</id>
      <properties>
        <profile.testOutputDirectory>war/WEB-INF/classes</profile.testOutputDirectory>
      </properties>

      <build>        
        <testResources>
          <testResource>
            <directory>src/test/java</directory>
          </testResource>
          <testResource>
            <directory>src/test/resources</directory>
          </testResource>
        </testResources>
        <plugins>
          <plugin>
            <artifactId>maven-failsafe-plugin</artifactId>
            <configuration>
              <additionalClasspathElements>
                <additionalClasspathElement>${basedir}/${profile.testOutputDirectory}/</additionalClasspathElement>
                <additionalClasspathElement>${basedir}/src/test/java/</additionalClasspathElement>
              </additionalClasspathElements>
              <forkMode>pertest</forkMode>
              <!-- DO NOT REMOVE THE errai.ioc.experimental.infer_dependent_by_reachability 
                flag or the testsuite WILL fail. -->
              <argLine>-Xmx1500m -Derrai.devel.nocache=true -Dgwt.args='-testBeginTimeout 5 ${gwtArgs}' -Derrai.hosted_mode_testing=true -Derrai.ioc.experimental.infer_dependent_by_reachability=true -Dorg.jboss.errai.bus.do_long_poll=false</argLine>
              <includes>
                <include>**/*Test.java</include>
                <include>**/*Tests.java</include>
              </includes>
            </configuration>
          </plugin>
          <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
              <excludes>
                <exclude>com/google/gwt/junit/JUnitShell.java</exclude>
              </excludes>
            </configuration>
          </plugin>
        </plugins>
      </build>

      <dependencies> 
        <dependency>
          <groupId>log4j</groupId>
          <artifactId>log4j</artifactId>
        </dependency>
        <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <scope>compile</scope>
        </dependency>

        <!-- Errai Core -->
        <dependency>
          <groupId>org.jboss.errai</groupId>
          <artifactId>errai-common</artifactId>
        </dependency>              

        <dependency>
          <groupId>org.jboss.errai</groupId>
          <artifactId>errai-bus</artifactId>
        </dependency>
        
        <dependency>
          <groupId>org.jboss.errai</groupId>
          <artifactId>errai-bus</artifactId>
          <type>test-jar</type>
          <scope>test</scope>
        </dependency>
        
        <dependency>
          <groupId>org.jboss.errai</groupId>
          <artifactId>errai-ioc</artifactId>
          <exclusions>
            <exclusion>
              <groupId>javax.inject</groupId>
              <artifactId>javax.inject</artifactId>
            </exclusion>
            <exclusion>
              <groupId>javax.annotation</groupId>
              <artifactId>jsr250-api</artifactId>
            </exclusion>
          </exclusions>        
        </dependency>
        
         <dependency>
          <groupId>org.jboss.errai</groupId>
          <artifactId>errai-ioc</artifactId>
          <type>test-jar</type>
          <scope>test</scope>
        </dependency>

        <dependency>
          <groupId>org.jboss.errai</groupId>
          <artifactId>errai-cdi-client</artifactId>
          <scope>compile</scope>
        </dependency>
        
        <dependency>
          <groupId>org.jboss.errai</groupId>
          <artifactId>errai-cdi-client</artifactId>
          <type>test-jar</type>
          <scope>test</scope>
        </dependency>

        <dependency>
          <groupId>org.jboss.errai</groupId>
          <artifactId>errai-ioc-bus-support</artifactId>
        </dependency>      

        <dependency>
          <groupId>org.jboss.errai</groupId>
          <artifactId>errai-tools</artifactId>
        </dependency>

        <dependency>
          <groupId>org.mvel</groupId>
          <artifactId>mvel2</artifactId>
        </dependency>

        <!-- CDI Development Utils -->
        <!-- This must be placed above com.google.gwt:gwt-dev to override 
          the Jetty that is present there -->
        <dependency>
          <groupId>org.mortbay.jetty</groupId>
          <artifactId>jetty</artifactId>
        </dependency>
        <dependency>
          <groupId>org.mortbay.jetty</groupId>
          <artifactId>jetty-plus</artifactId>
        </dependency>
        <dependency>
          <groupId>org.mortbay.jetty</groupId>
          <artifactId>jetty-naming</artifactId>
        </dependency>

        <!-- Weld Modules -->
        <dependency>
          <groupId>org.jboss.weld</groupId>
          <artifactId>weld-core</artifactId>
        </dependency>
        <dependency>
          <groupId>org.jboss.weld.se</groupId>
          <artifactId>weld-se-core</artifactId>
        </dependency>
        <dependency>
          <groupId>org.jboss.weld.servlet</groupId>
          <artifactId>weld-servlet</artifactId>
        </dependency>

        <!-- GWT and GWT Extensions -->
        <dependency>
          <groupId>com.google.gwt</groupId>
          <artifactId>gwt-user</artifactId>
          <scope>compile</scope>
        </dependency>

        <dependency>
          <groupId>com.google.gwt</groupId>
          <artifactId>gwt-dev</artifactId>
          <scope>compile</scope>
        </dependency>

        <dependency>
          <groupId>javax.validation</groupId>
          <artifactId>validation-api</artifactId>
          <scope>compile</scope>
        </dependency>

        <dependency>
          <groupId>javax.validation</groupId>
          <artifactId>validation-api</artifactId>
          <classifier>sources</classifier>
          <scope>compile</scope>
        </dependency>

        <!-- Runtime / Container dependencies -->
        <dependency>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-log4j12</artifactId>
          <scope>test</scope>
        </dependency>

        <dependency>
          <groupId>org.jboss</groupId>
          <artifactId>jboss-common-core</artifactId>
        </dependency>

        <dependency>
          <groupId>org.jboss.errai</groupId>
          <artifactId>errai-javax-enterprise</artifactId>
          <scope>provided</scope>
        </dependency>

        <dependency>
          <groupId>org.jboss.errai</groupId>
          <artifactId>errai-data-binding</artifactId>
          <scope>provided</scope>
        </dependency>        
      </dependencies>
    </profile>
  </profiles>
</project>
