<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (C) 2011 ConnId (connid-dev@googlegroups.com)

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

            http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<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/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>net.tirasa.connid.bundles.soap</groupId>
    <artifactId>soap</artifactId>
    <version>1.4.0</version>
  </parent>
    
  <groupId>net.tirasa.connid.bundles.soap</groupId>
  <artifactId>wssample</artifactId>

  <name>Bundles: SOAP: WS Sample</name>

  <packaging>war</packaging>

  <properties>
    <rootpom.basedir>${basedir}/..</rootpom.basedir>
  </properties>

  <dependencies>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
    </dependency>
    <dependency>
      <groupId>javax.servlet.jsp</groupId>
      <artifactId>jsp-api</artifactId>
    </dependency>
    
    <dependency>
      <groupId>javax.xml.ws</groupId>
      <artifactId>jaxws-api</artifactId>
      <version>2.2.11</version>
    </dependency>

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

    <!-- Logger -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-core</artifactId>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
    </dependency>
    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>jcl-over-slf4j</artifactId>
    </dependency>

    <!-- CXF Dependencies -->
    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-rt-frontend-jaxws</artifactId>
    </dependency>
    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-rt-transports-http</artifactId>
    </dependency>

    <!-- Spring Dependencies -->
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-core</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-web</artifactId>
    </dependency>

    <!-- to be excluded to deploy on jetty and test the connector -->
    <dependency>
      <groupId>org.apache.geronimo.specs</groupId>
      <artifactId>geronimo-activation_1.1_spec</artifactId>
      <scope>provided</scope>
    </dependency>

    <!-- utilities -->
    <dependency>
      <groupId>net.tirasa.connid.bundles.soap</groupId>
      <artifactId>soap-utilities</artifactId>
      <version>${project.version}</version>
    </dependency>

    <!-- persistence dependencies -->
    <dependency>
      <groupId>org.hsqldb</groupId>
      <artifactId>hsqldb</artifactId>
    </dependency>
    <dependency>
      <groupId>org.dbunit</groupId>
      <artifactId>dbunit</artifactId>
    </dependency>
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-jdbc</artifactId>
    </dependency>
        
    <!-- Test dependencies -->
    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-test</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <inherited>true</inherited>
        <configuration>
          <webResources>
            <resource>
              <directory>src/main/webapp</directory>
              <includes>
                <include>**/*.jsp</include>
                <include>WEB-INF/web.xml</include>
              </includes>
              <filtering>true</filtering>
            </resource>
            <!--
                 HACK: Include legal files explicity, otherwise they will end up in the wrong path
                       or in another jar file in the war.
            -->
            <resource>
              <directory>${project.build.outputDirectory}</directory>
              <includes>
                <include>META-INF/DEPENDENCIES*</include>
              </includes>
            </resource>
            <resource>
              <directory>${basedir}/..</directory>
              <targetPath>META-INF</targetPath>
              <includes>
                <include>LICENSE</include>
                <include>NOTICE</include>
              </includes>
            </resource>
          </webResources>
          <packagingExcludes>WEB-INF/classes/META-INF/LICENSE*,WEB-INF/classes/META-INF/NOTICE*,WEB-INF/classes/META-INF/DEPENDENCIES*</packagingExcludes>
        </configuration>
      </plugin>
        
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <encoding>utf-8</encoding>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-maven-plugin</artifactId>
        <inherited>true</inherited>
        <configuration>
          <scanIntervalSeconds>10</scanIntervalSeconds>
          <stopKey>foo</stopKey>
          <stopPort>9999</stopPort>

          <httpConnector>
            <port>8888</port>
          </httpConnector>

          <webApp>
            <contextPath>/wssample</contextPath>
          </webApp>
        </configuration>
        <executions>
          <execution>
            <id>start-jetty</id>
            <phase>pre-integration-test</phase>
                        
            <goals>
              <goal>deploy-war</goal>
            </goals>

            <configuration>
              <scanIntervalSeconds>0</scanIntervalSeconds>
              <daemon>true</daemon>
            </configuration>
          </execution>
          <execution>
            <id>stop-jetty</id>
            <phase>post-integration-test</phase>
            <goals>
              <goal>stop</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
    
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>false</filtering>
      </resource>
    </resources>
  </build>
</project>
