<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>
  <parent>
    <groupId>org.jboss.errai</groupId>
    <artifactId>errai-security</artifactId>
    <version>4.3.3.Final</version>
  </parent>
  <artifactId>errai-security-client</artifactId>
  <name>Errai::Security::Client</name>

  <dependencies>
    <dependency>
      <groupId>org.jboss.errai</groupId>
      <artifactId>errai-bus</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.errai</groupId>
      <artifactId>errai-common</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.errai</groupId>
      <artifactId>errai-ui</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.errai</groupId>
      <artifactId>errai-data-binding</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.errai</groupId>
      <artifactId>errai-navigation</artifactId>
    </dependency>

    <dependency>
      <groupId>org.jboss.spec.javax.interceptor</groupId>
      <artifactId>jboss-interceptors-api_1.2_spec</artifactId>
    </dependency>

    <dependency>
      <groupId>org.jboss.errai</groupId>
      <artifactId>errai-ioc</artifactId>
      <exclusions>
        <exclusion>
          <artifactId>javax.el-api</artifactId>
          <groupId>javax.el</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.jboss.errai</groupId>
      <artifactId>errai-ioc-bus-support</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.errai</groupId>
      <artifactId>errai-cdi-client</artifactId>
    </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-security-server</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.errai</groupId>
      <artifactId>errai-jaxrs-client</artifactId>
    </dependency>
    <dependency>
      <groupId>org.glassfish</groupId>
      <artifactId>javax.el</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.hibernate.javax.persistence</groupId>
      <artifactId>hibernate-jpa-2.1-api</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.spec.javax.el</groupId>
      <artifactId>jboss-el-api_3.0_spec</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.spec.javax.ws.rs</groupId>
      <artifactId>jboss-jaxrs-api_2.0_spec</artifactId>
    </dependency>

    <!-- GWT -->
    <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>org.jboss.errai</groupId>
      <artifactId>errai-cdi-server</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.errai</groupId>
      <artifactId>errai-jaxrs-provider</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.weld.servlet</groupId>
      <artifactId>weld-servlet-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.resteasy</groupId>
      <artifactId>resteasy-jaxrs</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jboss.weld.se</groupId>
      <artifactId>weld-se-core</artifactId>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>el-api</artifactId>
          <groupId>javax.el</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.jboss.logging</groupId>
      <artifactId>jboss-logging</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.gwt.gwtmockito</groupId>
      <artifactId>gwtmockito</artifactId>      
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.deltaspike.core</groupId>
      <artifactId>deltaspike-core-api</artifactId>      
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-server</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

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

    <resources>
      <resource>
        <directory>target/generated-sources</directory>
      </resource>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
      <resource>
        <directory>src/main/java</directory>
        <includes>
          <include>**/*.java</include>
          <include>**/*.gwt.xml</include>
        </includes>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <configuration>
          <excludes>**/InvocationContext.java</excludes>
        </configuration>
        <executions>
          <execution>
            <id>unpack</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <!-- Do not put version here. Managed version will be used. -->
                  <groupId>org.jboss.spec.javax.interceptor</groupId>
                  <artifactId>jboss-interceptors-api_1.2_spec</artifactId>
                  <classifier>sources</classifier>
                  <overWrite>false</overWrite>
                  <outputDirectory>target/generated-sources/javax/interceptor/super</outputDirectory>
                </artifactItem>
              </artifactItems>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>integration-test</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <!-- Override exclusions in parent -->
            <configuration combine.self="override">
              <excludes>
              </excludes>
              <includes>
                <include>**/mocksafe/**/*Test.java</include>
                <include>**/mocksafe/**/*Tests.java</include>
              </includes>
              <useSystemClassLoader>true</useSystemClassLoader>
              <useManifestOnlyJar>true</useManifestOnlyJar>
              <additionalClasspathElements>
                <additionalClasspathElement>${basedir}/target/classes/</additionalClasspathElement>
                <additionalClasspathElement>${basedir}/test-classes/</additionalClasspathElement>
                <additionalClasspathElement>${basedir}/src/main/java/</additionalClasspathElement>
                <additionalClasspathElement>${basedir}/src/test/java/</additionalClasspathElement>
              </additionalClasspathElements>
            </configuration>
          </plugin>
          <plugin>
            <artifactId>maven-failsafe-plugin</artifactId>
            <configuration>
              <forkMode>always</forkMode>
              <argLine>-Xmx1500m ${argLine} -Dgwt.args='-prod'</argLine>
              <useManifestOnlyJar>true</useManifestOnlyJar>

              <systemProperties>
                <property>
                  <name>java.io.tmpdir</name>
                  <value>${project.build.directory}</value>
                </property>
                <property>
                  <name>log4j.output.dir</name>
                  <value>${project.build.directory}</value>
                </property>

                <!-- Must disable long polling for automated tests to succeed -->
                <property>
                  <name>errai.hosted_mode_testing</name>
                  <value>true</value>
                </property>

                <!-- Disable caching of generated code -->
                <property>
                  <name>errai.devel.nocache</name>
                  <value>true</value>
                </property>
              </systemProperties>
              <excludes>
                <exclude>**/mocksafe/**</exclude>
              </excludes>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
