<?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-parent</artifactId>
    <groupId>org.jboss.errai</groupId>
    <version>3.1.1.Final</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>

  <artifactId>errai-validation</artifactId>
  <name>Errai::Validation</name>

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

  <dependencies>
    <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-marshalling</artifactId>
    </dependency>

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

    <!-- 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>junit</groupId>
      <artifactId>junit</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>
  </dependencies>

  <profiles>
    <profile>
      <id>integration-test</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-failsafe-plugin</artifactId>
            <configuration>
              <skipTests>false</skipTests>
              <additionalClasspathElements>
                <additionalClasspathElement>${basedir}/${testOutputDirectory}/</additionalClasspathElement>
                <additionalClasspathElement>${basedir}/src/main/java/</additionalClasspathElement>
                <additionalClasspathElement>${basedir}/src/test/java/</additionalClasspathElement>
              </additionalClasspathElements>
              <useManifestOnlyJar>false</useManifestOnlyJar>
              <forkMode>pertest</forkMode>
              <argLine>${argLine} -Xmx1500m -Derrai.devel.nocache=true -Derrai.codegen.permissive=false</argLine>

              <systemProperties>
                <!-- Must disable long polling for automated tests to succeed -->
                <property>
                  <name>errai.hosted_mode_testing</name>
                  <value>true</value>
                </property>
                <!-- Do not accidently package server test marshallers when 
                  building Errai -->
                <property>
                  <name>errai.marshalling.server.classOutput.enabled</name>
                  <value>false</value>
                </property>
              </systemProperties>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.jboss.errai</groupId>
            <artifactId>jacoco-gwt-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>jacoco-initialize</id>
                <phase>initialize</phase>
                <goals>
                  <goal>prepare-agent</goal>
                </goals>
              </execution>
              <execution>
                <id>jacoco-site</id>
                <phase>site</phase>
                <goals>
                  <goal>report</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
      <dependencies>
        <dependency>
          <groupId>org.hibernate</groupId>
          <artifactId>hibernate-validator</artifactId>
          <scope>provided</scope>
        </dependency>
        <dependency>
          <groupId>org.hibernate</groupId>
          <artifactId>hibernate-validator</artifactId>
          <scope>provided</scope>
          <classifier>sources</classifier>
        </dependency>
      </dependencies>
    </profile>
  </profiles>
</project>
