<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>org.codehaus.enunciate</groupId>
    <artifactId>enunciate-parent</artifactId>
    <version>1.30</version>
  </parent>

  <artifactId>enunciate-java-client</artifactId>
  <name>Enunciate - Java Client Module</name>
  <description>The Enunciate Java Client module generates the client-side artifacts for invoking a web service endpoint via Java.</description>

  <build>
    <testResources>
      <testResource>
        <directory>${basedir}/src/test/resources</directory>
      </testResource>
      <testResource>
        <directory>${project.build.directory}/enunciate/gen/java-client</directory>
        <excludes>
          <exclude>**/*.java</exclude>
        </excludes>
      </testResource>
    </testResources>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <!--<debugForkedProcess>true</debugForkedProcess>-->
          <systemProperties>
            <property>
              <name>in.apt.src.test.dir</name>
              <value>${basedir}/src/main/samples/java-client</value>
            </property>
          </systemProperties>
        </configuration>
      </plugin>
      <plugin>
        <!--
        we need to generate some java client-side classes for testing purposes.
        we'll use the Enunciate ant task to do it.
        -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>enunciate</id>
            <phase>generate-test-resources</phase>
            <configuration>
              <tasks>
                <path id="enunciate.classpath">
                  <path refid="maven.test.classpath" />
                  <pathelement location="${java.home}/../lib/tools.jar" />
                </path>

                <taskdef name="enunciate" classname="org.codehaus.enunciate.main.EnunciateTask">
                  <classpath refid="enunciate.classpath" />
                </taskdef>

                <mkdir dir="${project.build.directory}/enunciate/gen" />
                <mkdir dir="${project.build.directory}/enunciate/compile" />

                <enunciate target="generate" basedir="${basedir}/src/main/samples/schema" configFile="${basedir}/src/main/samples/schema/enunciate.xml" generateDir="${project.build.directory}/enunciate/gen">
                  <include name="**/*.java" />
                  <classpath refid="enunciate.classpath" />
                </enunciate>
              </tasks>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <!--now we need to add the generated sources we're testing to the test classpath-->
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>add-test-source</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-test-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>${basedir}/src/main/samples/schema</source>
                <source>${project.build.directory}/enunciate/gen/java-client</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>enunciate-core</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>enunciate-xml</artifactId>
      <version>${project.version}</version>
    </dependency>

    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>enunciate-core</artifactId>
      <version>${project.version}</version>

      <classifier>tests</classifier>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>joda-time</groupId>
      <artifactId>joda-time</artifactId>

      <!--for testing the xmladapters only-->
      <scope>test</scope>
    </dependency>

    <dependency>
      <!--depending modules: jersey-rt-->
      <groupId>org.codehaus.jackson</groupId>
      <artifactId>jackson-jaxrs</artifactId>

      <scope>test</scope>
    </dependency>

    <dependency>
      <!--depending modules: jersey-rt-->
      <groupId>org.codehaus.jackson</groupId>
      <artifactId>jackson-xc</artifactId>

      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>com.sun.jersey</groupId>
      <artifactId>jersey-server</artifactId>

      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>javax.mail</groupId>
      <artifactId>mail</artifactId>

      <scope>test</scope>
    </dependency>
  </dependencies>

</project>
