<?xml version="1.0" encoding="UTF-8"?>
<!--
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - JOnAS: Java(TM) Open Application Server
  - Copyright (C) 2010 Bull S.A.S.
  - Contact: jonas-team@ow2.org
  -
  - This library is free software; you can redistribute it and/or
  - modify it under the terms of the GNU Lesser General Public
  - License as published by the Free Software Foundation; either
  - version 2.1 of the License, or any later version.
  -
  - This library is distributed in the hope that it will be useful,
  - but WITHOUT ANY WARRANTY; without even the implied warranty of
  - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  - Lesser General Public License for more details.
  -
  - You should have received a copy of the GNU Lesser General Public
  - License along with this library; if not, write to the Free Software
  - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
  - USA
  -
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - $Id$
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-->
<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">
  <parent>
    <groupId>org.ow2.jonas</groupId>
    <artifactId>jonas-itests-applications</artifactId>
    <version>5.2.0-M2-SR1</version>
    <relativePath>../pom.xml</relativePath>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.ow2.jonas</groupId>
  <artifactId>jonas-itests-applications-jaxws-sample</artifactId>
  <packaging>ear</packaging>
  <name>JOnAS :: iTests :: Applications :: JAX-WS sample</name>
  <description>JAX-WS sample from the JOnAS JAX-WS tutorial</description>

  <properties>
    <jonas.root>${project.build.directory}/jonas-full-${project.version}</jonas.root>
  </properties>

  <build>
    <plugins>

      <plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <id>unpack-assembly</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>org.ow2.jonas.assemblies.profiles</groupId>
                  <artifactId>jonas-full</artifactId>
                  <version>${project.version}</version>
                  <classifier>bin</classifier>
                  <type>zip</type>
                  <outputDirectory>${project.build.directory}</outputDirectory>
                </artifactItem>
              </artifactItems>
              <overWriteReleases>true</overWriteReleases>
              <overWriteSnapshots>true</overWriteSnapshots>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>generate-jaxws-sample</id>
            <phase>generate-resources</phase>
            <configuration>
              <tasks>
                <mkdir dir="${project.build.directory}" />
                <ant dir="${jonas.root}/tutorial/jaxws-sample" target="build-deploy-service">
                  <property name="myenv.JONAS_ROOT" value="${jonas.root}" />
                  <property name="myenv.JONAS_BASE" value="${project.build.directory}" />
                </ant>

                <unzip src="${project.build.directory}/deploy/quote.ear" dest="${project.build.directory}/${project.artifactId}-${project.version}" />
              </tasks>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-ear-plugin</artifactId>
        <configuration>
          <archive>
            <manifestEntries>
              <Implementation-Version>${project.version}</Implementation-Version>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
