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

  <artifactId>errai-jaxrs-client</artifactId>
  <name>Errai::JAX-RS::Client</name>

  <build>
    <testOutputDirectory>war/WEB-INF/classes</testOutputDirectory>
    <resources>
      <resource>
        <directory>src/main/java</directory>
      </resource>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
    </resources>
    <plugins>
      <!-- exclude JAX-RS API overrides as they'd pollute the server classpath in GWTTestCases -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <excludes>
            <exclude>**/javax/ws/rs/core/*.java</exclude>
          </excludes>
        </configuration>
      </plugin>
    </plugins>
  </build>

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

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

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

    <dependency>
      <groupId>org.jboss.resteasy</groupId>
      <artifactId>jaxrs-api</artifactId>
    </dependency>

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava-gwt</artifactId>
    </dependency>

    <dependency>
      <groupId>org.jboss.errai</groupId>
      <artifactId>errai-jaxrs-provider</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.jboss.resteasy</groupId>
      <artifactId>resteasy-jaxrs</artifactId>
      <version>${resteasy.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.codehaus.jackson</groupId>
      <artifactId>jackson-mapper-asl</artifactId>
      <version>1.9.12</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <profiles>
    <profile>
      <id>integration-test</id>
      <build>
      <plugins>
        <plugin>
          <artifactId>maven-surefire-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</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>

            <includes>
              <include>**/AllJaxrsTests.java</include>
            </includes>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.jboss.errai</groupId>
          <artifactId>jacoco-gwt-maven-plugin</artifactId>
          <version>0.5.4.201202141554</version>
          <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>
    </profile>
  </profiles>
</project>
