<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-docs</artifactId>
  <name>Enunciate - Docs Module</name>
  <description>The Enunciate Docs module generates the Web service API documentation.</description>

  <properties>
    <!--The directory where the sample api code is for this module, for testing purposes-->
    <api.sample.dir>${basedir}/src/test/samples</api.sample.dir>
  </properties>

  <build>
    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
        <!--filter the test properties. we use test properties instead of configuring the surefire plugin so the tests can be run from the IDE.-->
        <filtering>true</filtering>
      </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/docs</value>
            </property>
          </systemProperties>
        </configuration>
      </plugin>
      <plugin>
        <!--
        we need to zip up the default documentation base, so we'll use ant to do it.
        -->
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <!--the docs module uses a default base.-->
            <phase>process-classes</phase>
            <configuration>
              <tasks>
                <mkdir dir="${project.build.outputDirectory}" />

                <zip destfile="${project.build.outputDirectory}/docs.base.zip" basedir="${basedir}/template">
                  <exclude name="*.html" />
                </zip>
              </tasks>
            </configuration>
            <goals>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <!--add the sample dir to the test sources-->
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>add-test-source</id>
            <phase>initialize</phase>
            <goals>
              <goal>add-test-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>${api.sample.dir}</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>org.freemarker</groupId>
      <artifactId>freemarker</artifactId>
    </dependency>

    <!--used for generating example json for documentation-->
    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
    </dependency>

    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>enunciate-jackson</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-library</artifactId>
      <version>${hamcrest.version}</version>
      <scope>test</scope>
    </dependency>

  </dependencies>

</project>
