<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>
  <artifactId>camunda-engine-rest</artifactId>
  <name>camunda BPM - engine - REST</name>
  <packaging>war</packaging>

  <parent>
    <groupId>org.camunda.bpm</groupId>
    <artifactId>camunda-parent</artifactId>
    <relativePath>../parent</relativePath>
    <version>7.2.0-alpha5</version>
  </parent>

  <properties>
    <rest.http.port>8080</rest.http.port>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.codehaus.jackson</groupId>
      <artifactId>jackson-jaxrs</artifactId>
      <version>${jackson.version}</version>
    </dependency>

    <dependency>
      <groupId>org.camunda.bpm</groupId>
      <artifactId>camunda-engine</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>commons-fileupload</groupId>
      <artifactId>commons-fileupload</artifactId>
    </dependency>

    <dependency>
      <groupId>org.jboss.spec</groupId>
      <artifactId>jboss-javaee-6.0</artifactId>
      <type>pom</type>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <artifactId>xalan</artifactId>
          <groupId>org.apache.xalan</groupId>
        </exclusion>
      </exclusions>
    </dependency>

    <!-- test -->
    <!-- resteasy -->
    <dependency>
      <groupId>org.jboss.resteasy</groupId>
      <artifactId>resteasy-jaxrs</artifactId>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>httpclient</artifactId>
          <groupId>org.apache.httpcomponents</groupId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>org.jboss.resteasy</groupId>
      <artifactId>resteasy-netty</artifactId>
      <scope>test</scope>
    </dependency>

    <!-- jersey -->
    <dependency>
      <groupId>com.sun.jersey</groupId>
      <artifactId>jersey-grizzly2</artifactId>
      <version>1.17.1</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
      <scope>test</scope>
    </dependency>

    <!-- Wink test dependencies -->

    <dependency>
      <groupId>org.apache.wink</groupId>
      <artifactId>wink-server</artifactId>
      <version>1.1.1-incubating</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <version>1.5.6</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.tomcat.embed</groupId>
      <artifactId>tomcat-embed-core</artifactId>
      <version>${version.tomcat}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.tomcat.embed</groupId>
      <artifactId>tomcat-embed-logging-juli</artifactId>
      <version>${version.tomcat}</version>
      <scope>test</scope>
    </dependency>

    <!-- only included to prevent java.lang.ClassNotFoundException: org.apache.jasper.servlet.JspServlet -->
    <!-- removing this dep. will not break the tests, but makes them "ugly"-->
    <dependency>
      <groupId>org.apache.tomcat.embed</groupId>
      <artifactId>tomcat-embed-jasper</artifactId>
      <version>${version.tomcat}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.jboss.shrinkwrap.resolver</groupId>
      <artifactId>shrinkwrap-resolver-depchain</artifactId>
      <version>${version.shrinkwrap.resolvers}</version>
      <scope>test</scope>
      <type>pom</type>
    </dependency>

    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>org.hamcrest</groupId>
          <artifactId>hamcrest-core</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>org.codehaus.jettison</groupId>
      <artifactId>jettison</artifactId>
      <version>1.3.2</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>com.jayway.restassured</groupId>
      <artifactId>rest-assured</artifactId>
      <version>1.8.1</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>org.codehaus.groovy</groupId>
          <artifactId>groovy</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <!-- version must be the same as used by restassured -->
    <dependency>
      <groupId>org.codehaus.groovy</groupId>
      <artifactId>groovy-all</artifactId>
      <version>2.1.2</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>commons-codec</groupId>
      <artifactId>commons-codec</artifactId>
      <!-- override version -->
      <version>1.6</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.easytesting</groupId>
      <artifactId>fest-assert</artifactId>
      <version>1.4</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-mock</artifactId>
      <version>2.0.8</version>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <build>
    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
        <filtering>true</filtering>
      </testResource>
      <testResource>
        <directory>src/test/embedded-resources</directory>
        <filtering>true</filtering>
      </testResource>
    </testResources>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <id>create-jar</id>
            <goals>
              <goal>jar</goal>
            </goals>
            <phase>package</phase>
            <configuration>
              <classifier>classes</classifier>
              <excludes>
                <exclude>org/camunda/bpm/engine/rest/impl/application/DefaultApplication.class</exclude>
              </excludes>
            </configuration>
          </execution>
          <execution>
            <id>create-test-jar</id>
            <phase>package</phase>
            <goals>
              <goal>test-jar</goal>
            </goals>
            <configuration>
              <forceCreation>true</forceCreation>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <configuration>
          <failOnMissingWebXml>false</failOnMissingWebXml>
          <archive>
            <manifest>
              <!-- Maven project version number -->
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
            </manifest>
            <manifestEntries>
              <!-- module dependencies for deployment on AS 7  -->
              <Dependencies>org.camunda.bpm.camunda-engine</Dependencies>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <id>tomcat</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>assembly-tomcat.xml</descriptor>
              </descriptors>
              <finalName>camunda-engine-rest-${project.version}</finalName>
              <attach>true</attach>
              <classifier>tomcat</classifier>
              <outputDirectory>target/</outputDirectory>
              <workDirectory>target/assembly/work</workDirectory>
            </configuration>
          </execution>

          <execution>
            <id>was</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>assembly-was.xml</descriptor>
              </descriptors>
              <finalName>camunda-engine-rest-${project.version}</finalName>
              <attach>true</attach>
              <classifier>was</classifier>
              <outputDirectory>target/</outputDirectory>
              <workDirectory>target/assembly/work</workDirectory>
            </configuration>
          </execution>

          <execution>
            <id>wls</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>assembly-wls.xml</descriptor>
              </descriptors>
              <finalName>camunda-engine-rest-${project.version}</finalName>
              <attach>true</attach>
              <classifier>wls</classifier>
              <outputDirectory>target/</outputDirectory>
              <workDirectory>target/assembly/work</workDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>

    </plugins>
  </build>

  <profiles>
    <profile>
      <id>distro</id>
      <properties>
        <jackson.version>1.9.11</jackson.version>
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <skipTests>true</skipTests>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>embedded-rest</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <properties>
        <rest.http.port>38080</rest.http.port>
        <jackson.version>1.9.11</jackson.version>
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <systemPropertyVariables>
                <org.apache.maven.user-settings>../settings/maven/nexus-settings.xml</org.apache.maven.user-settings>
              </systemPropertyVariables>
              <excludes>
                <exclude>**/Abstract*</exclude>
              </excludes>
              <redirectTestOutputToFile>true</redirectTestOutputToFile>
            </configuration>
            <executions>
              <execution>
                <id>default-test</id>
                <configuration>
                  <includes>
                    <include>**/rest/standalone/**</include>
                  </includes>
                  <excludes>
                    <exclude>**/rest/standalone/ServletAuthenticationFilterTest*</exclude>
                    <exclude>**/rest/resteasy/**</exclude>
                    <exclude>**/rest/jersey/**</exclude>
                    <exclude>**/rest/wink/**</exclude>
                    <exclude>**/rest/history/**</exclude>
                  </excludes>
                </configuration>
              </execution>
              <execution>
                <id>serlvet-authentication-test</id>
                <goals>
                  <goal>test</goal>
                </goals>
                <phase>test</phase>
                <configuration>
                  <includes>
                    <include>**/rest/standalone/ServletAuthenticationFilterTest*</include>
                  </includes>
                </configuration>
              </execution>
              <execution>
                <id>resteasy-tests</id>
                <goals>
                  <goal>test</goal>
                </goals>
                <phase>test</phase>
                <configuration>
                  <includes>
                    <include>**/rest/resteasy/**</include>
                    <include>**/rest/history/resteasy/**</include>
                  </includes>
                  <excludes>
                    <exclude>**/rest/jersey/**</exclude>
                    <exclude>**/rest/history/jersey/**</exclude>
                    <exclude>**/rest/wink/**</exclude>
                    <exclude>**/rest/history/wink/**</exclude>
                    <exclude>**/rest/standalone/**</exclude>
                  </excludes>
                </configuration>
              </execution>
              <execution>
                <id>jersey-tests</id>
                <goals>
                  <goal>test</goal>
                </goals>
                <phase>test</phase>
                <configuration>
                  <includes>
                    <include>**/rest/jersey/**</include>
                    <include>**/rest/history/jersey/**</include>
                  </includes>
                  <excludes>
                    <exclude>**/rest/resteasy/**</exclude>
                    <exclude>**/rest/history/resteasy/**</exclude>
                    <exclude>**/rest/wink/**</exclude>
                    <exclude>**/rest/history/wink/**</exclude>
                    <exclude>**/rest/standalone/**</exclude>
                  </excludes>
                </configuration>
              </execution>
              <execution>
                <id>wink-tests</id>
                <goals>
                  <goal>test</goal>
                </goals>
                <phase>test</phase>
                <configuration>
                  <includes>
                    <include>**/rest/wink/**</include>
                    <include>**/rest/history/wink/**</include>
                  </includes>
                  <excludes>
                    <exclude>**/rest/resteasy/**</exclude>
                    <exclude>**/rest/history/resteasy/**</exclude>
                    <exclude>**/rest/jersey/**</exclude>
                    <exclude>**/rest/history/jersey/**</exclude>
                    <exclude>**/rest/standalone/**</exclude>
                  </excludes>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>was-compatibility</id>
      <properties>
        <rest.http.port>38080</rest.http.port>
        <jackson.version>1.6.2</jackson.version>
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <systemPropertyVariables>
                <org.apache.maven.user-settings>../settings/maven/nexus-settings.xml</org.apache.maven.user-settings>
              </systemPropertyVariables>
              <excludes>
                <exclude>**/Abstract*</exclude>
              </excludes>
              <redirectTestOutputToFile>true</redirectTestOutputToFile>
            </configuration>
            <executions>
              <execution>
                <id>default-test</id>
                <goals>
                  <goal>test</goal>
                </goals>
                <phase>test</phase>
                <configuration>
                  <includes>
                    <include>**/rest/wink/**</include>
                    <include>**/rest/history/wink/**</include>
                  </includes>
                  <excludes>
                    <exclude>**/rest/resteasy/**</exclude>
                    <exclude>**/rest/history/resteasy/**</exclude>
                    <exclude>**/rest/jersey/**</exclude>
                    <exclude>**/rest/history/jersey/**</exclude>
                    <exclude>**/rest/standalone/**</exclude>
                  </excludes>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>wls-compatibility</id>
      <dependencies>
        <dependency>
          <groupId>joda-time</groupId>
          <artifactId>joda-time</artifactId>
          <version>1.2.1</version>
        </dependency>
      </dependencies>
    </profile>

  </profiles>
</project>
