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

  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.jbpm</groupId>
    <artifactId>jbpm-gwt</artifactId>
    <version>5.4.0.CR1</version>
  </parent>

  <artifactId>jbpm-gwt-console-server</artifactId>
  <packaging>war</packaging>

  <name>jBPM Console server WAR</name>

  <dependencies>
    <dependency>
      <groupId>org.jboss.bpm</groupId>
      <artifactId>gwt-console-server-jbpm</artifactId>
      <type>war</type>
    </dependency>
    <dependency>
      <groupId>org.jboss.bpm</groupId>
      <artifactId>activity-monitor-model</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jboss.bpm</groupId>
      <artifactId>gwt-console-server-integration</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jbpm</groupId>
      <artifactId>jbpm-gwt-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jbpm</groupId>
      <artifactId>jbpm-gwt-graph</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jbpm</groupId>
      <artifactId>jbpm-gwt-form</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jbpm</groupId>
      <artifactId>jbpm-gwt-shared</artifactId>
    </dependency>
    <dependency>
      <groupId>org.jbpm</groupId>
      <artifactId>jbpm-persistence-jpa</artifactId>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
    </dependency>
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-entitymanager</artifactId>
    </dependency>

    <!-- provided (by container at runtime) -->
    <dependency>
      <groupId>javax.transaction</groupId>
      <artifactId>jta</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.hibernate.javax.persistence</groupId>
      <artifactId>hibernate-jpa-2.0-api</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
    </dependency>
  </dependencies>
  
  <build>
    <pluginManagement>
     <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <configuration>
                <archive>
                    <manifestEntries>
                        <Dependencies>org.hornetq</Dependencies>
                    </manifestEntries>
                </archive>
               <!-- exclude old codec version from gwt-console-server -->
               <dependentWarExcludes>WEB-INF/lib/commons-codec-1.3.jar,WEB-INF/lib/mvel2-2.0.18-RC4.jar,META-INF/*.SF,META-INF/*.RSA</dependentWarExcludes>   
            </configuration>
          </plugin>
       </plugins>
    </pluginManagement>

    <!--  It's necessary to build the EE6 war here instead of in jbpm-distribution 
          because of problems caused by signing the wars -->
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>1.6</version>
        <executions>
          <execution>
            <id>unpack-war</id>
            <phase>package</phase>
            <configuration>
              <target>
                <unzip
                  src="${project.build.directory}/${project.artifactId}-${project.version}.war"
                  dest="${project.build.directory}/upacked-war" />
              </target>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <id>ee6</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>src/main/assembly/gwt-console-server-ee6.xml</descriptor>
              </descriptors>
              <archive>
                <manifestEntries>
                  <Dependencies>org.jboss.netty</Dependencies>
                </manifestEntries>
              </archive>
            </configuration>
          </execution>
          <execution>
            <id>as5</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>src/main/assembly/gwt-console-server-as5.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
