<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>com.webcohesion.enunciate</groupId>
    <artifactId>enunciate-parent</artifactId>
    <version>2.14.0</version>
  </parent>

  <artifactId>enunciate-gwt-json-overlay</artifactId>
  <name>Enunciate - GWT JSON Overlay Module</name>
  <description>The Enunciate GWT module generates the artifacts to support the GWT JSON Overlays for the JSON API data.</description>

  <build>
    <plugins>
      <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>
                <taskdef name="enunciate" classname="com.webcohesion.enunciate.EnunciateTask">
                  <classpath refid="maven.test.classpath" />
                </taskdef>

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

                <enunciate basedir="${basedir}/src/test/samples" configFile="${basedir}/src/test/samples/enunciate.xml" buildDir="${project.build.directory}/enunciate">
                  <include name="**/*.java" />
                  <classpath refid="maven.test.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/test/samples</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <systemProperties>
            <property>
              <name>source.dir</name>
              <value>${project.build.directory}/enunciate/gwt-json-overlay/src</value>
            </property>
            <property>
              <name>target.dir</name>
              <value>${project.build.directory}/gwt-json-overlay-classes</value>
            </property>
          </systemProperties>
        </configuration>
      </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-jackson</artifactId>
      <version>${project.version}</version>
    </dependency>

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

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

    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-user</artifactId>
    </dependency>

    <dependency>
      <groupId>org.freemarker</groupId>
      <artifactId>freemarker</artifactId>
    </dependency>

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

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

</project>
