<?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.2.4.Final</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.jboss.netty</groupId>
      <artifactId>netty</artifactId>
      <scope>provided</scope>
    </dependency>
  </dependencies>
  
  <build>
  	<pluginManagement>
	   <plugins>
          <plugin>
           <groupId>org.apache.maven.plugins</groupId>
        	<artifactId>maven-war-plugin</artifactId>
        	<version>2.0</version>
            <configuration>
               <!-- exclude old codec version from gwt-console-server -->
               <dependentWarExcludes>WEB-INF/lib/netty-3.1.5.GA.jar,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>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
