<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-examples</artifactId>
    <version>2.14.0</version>
  </parent>

  <artifactId>enunciate-examples-full-api-edge-cases</artifactId>
  <name>Enunciate - Full API With Edge Cases Example</name>
  <description>Enunciate Example: Full API with JAX-WS, JAX-RS, a bunch of edge cases to exercise the tool.</description>
  <packaging>war</packaging>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <!--skipping tests by default, to be enabled by the 'enunciate-full-tests' profile-->
          <skip>true</skip>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <executions>
          <execution>
            <id>default-testCompile</id>
            <phase>test-compile</phase>
            <goals>
              <goal>testCompile</goal>
            </goals>
            <configuration>
              <!--skipping test compilation by default, to be enabled by the 'enunciate-full-tests' profile-->
              <skip>true</skip>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.github.ekryd.echo-maven-plugin</groupId>
        <artifactId>echo-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>warn-limited-tests</id>
            <goals>
              <goal>echo</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <skip>${activate.full.tests}</skip>
          <level>WARNING</level>
          <message>You are compiling the ${project.artifactId} project without running the full test suite, which includes compiling and running the Enunciate-generated client-side code. In order to run the full suite, you will need to do a bunch of tricky environment setup. Enable the 'enunciate-full-tests' profile to start your path down the rabbit hole.</message>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>com.webcohesion.enunciate</groupId>
      <artifactId>enunciate-core-annotations</artifactId>
      <version>${enunciate.version}</version>
    </dependency>

    <dependency>
      <groupId>com.webcohesion.enunciate</groupId>
      <artifactId>enunciate-rt-util</artifactId>
      <version>${enunciate.version}</version>
    </dependency>

    <dependency>
      <groupId>com.sun.xml.ws</groupId>
      <artifactId>jaxws-rt</artifactId>
      <version>${jaxws-ri-rt.version}</version>
    </dependency>

    <dependency>
      <groupId>javax.xml.bind</groupId>
      <artifactId>jaxb-api</artifactId>
    </dependency>

    <dependency>
      <groupId>com.sun.xml.bind</groupId>
      <artifactId>jaxb-core</artifactId>
    </dependency>

    <dependency>
      <groupId>com.sun.xml.bind</groupId>
      <artifactId>jaxb-impl</artifactId>
    </dependency>

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

    <dependency>
      <groupId>org.codehaus.jackson</groupId>
      <artifactId>jackson-jaxrs</artifactId>
      <version>${jackson1.version}</version>
    </dependency>

    <dependency>
      <groupId>org.codehaus.jackson</groupId>
      <artifactId>jackson-xc</artifactId>
      <version>${jackson1.version}</version>
    </dependency>

    <dependency>
      <groupId>org.glassfish.jersey.containers</groupId>
      <artifactId>jersey-container-servlet</artifactId>
    </dependency>

    <dependency>
      <groupId>org.glassfish.jersey.media</groupId>
      <artifactId>jersey-media-multipart</artifactId>
    </dependency>

    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>

      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>joda-time</groupId>
      <artifactId>joda-time</artifactId>
      <version>${joda-time.version}</version>
    </dependency>

    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>${commons-io.version}</version>
    </dependency>

    <dependency>
      <groupId>commons-fileupload</groupId>
      <artifactId>commons-fileupload</artifactId>
      <version>${commons-fileupload.version}</version>
    </dependency>

    <dependency>
      <groupId>org.httpunit</groupId>
      <artifactId>httpunit</artifactId>
      <version>${httpunit-version}</version>

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

    <dependency>
      <groupId>javax.validation</groupId>
      <artifactId>validation-api</artifactId>
    </dependency>
    
    <dependency>
      <groupId>jakarta.validation</groupId>
      <artifactId>jakarta.validation-api</artifactId>
    </dependency>

  </dependencies>

  <profiles>
    <profile>
      <id>full-integration-tests</id>
      <activation>
        <property>
          <name>activate.full.tests</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
            <executions>
              <execution>
                <id>require.gmcs</id>
                <phase>validate</phase>
                <goals>
                  <goal>enforce</goal>
                </goals>
                <configuration>
                  <rules>
                    <requireProperty>
                      <property>gmcs.executable</property>
                      <message>
In order to build the ${project.artifactId} module, you must have Mono installed. First install Mono
for your platform. (See http://www.mono-project.com/docs/getting-started/ and note
there's a Windows version of Mono, too.) Then you will need to provide the Enunciate
build with a handle to it as follows:

* The 'gmcs.executable' build property must provide the path to your 'gmcs' executable.

Recommended configuration in settings.xml:

&lt;settings&gt;
  &lt;profiles&gt;
    &lt;profile&gt;
      &lt;id&gt;mono-installed&lt;/id&gt;
      &lt;activation&gt;
        &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
      &lt;/activation&gt;
      &lt;properties&gt;
        &lt;gmcs.executable&gt;gmcs&lt;/gmcs.executable&gt;
      &lt;/properties&gt;
    &lt;/profile&gt;
  &lt;/profiles&gt;
&lt;/settings&gt;</message>
                    </requireProperty>
                  </rules>
                </configuration>
              </execution>
              <execution>
                <id>require.gcc</id>
                <phase>validate</phase>
                <goals>
                  <goal>enforce</goal>
                </goals>
                <configuration>
                  <rules>
                    <requireProperty>
                      <property>gcc.executable</property>
                      <message>In order to build the ${project.artifactId} module, you must have gcc installed along with libxml and gnustep.
You will need to provide the Enunciate build with a handle to those things as follows:

* The 'gcc.executable' build property must provide the path to your 'gcc' executable.
* The 'libxml.config.executable' build property must provide your libxml compiler flags
  and library includes.
* The 'gnustep.config.executable' build property must provide your gnustep compiler flags
  and library includes.

Recommended configuration in settings.xml:

&lt;settings&gt;
  &lt;profiles&gt;
    &lt;profile&gt;
      &lt;id&gt;gcc-installed&lt;/id&gt;
      &lt;activation&gt;
        &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
      &lt;/activation&gt;
      &lt;properties&gt;
        &lt;gcc.executable&gt;gcc&lt;/gcc.executable&gt;
        &lt;libxml.config.executable&gt;xml2-config&lt;/libxml.config.executable&gt;
        &lt;gnustep.config.executable&gt;gnustep-config&lt;/gnustep.config.executable&gt;
      &lt;/properties&gt;
    &lt;/profile&gt;
  &lt;/profiles&gt;
&lt;/settings&gt;</message>
                    </requireProperty>
                  </rules>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>com.webcohesion.enunciate</groupId>
            <artifactId>enunciate-maven-plugin</artifactId>
            <version>${enunciate.version}</version>
            <executions>
              <execution>
                <id>assemble</id>
                <goals>
                  <goal>assemble</goal>
                </goals>
                <configuration>
                  <project-extensions>
                    <extension>java-xml-client</extension>
                  </project-extensions>
                  <exports>
                    <csharp.assembly>${project.build.directory}/cstests/${project.artifactId}.dll</csharp.assembly>
                  </exports>
                </configuration>
              </execution>
              <execution>
                <id>install-and-deploy</id>
                <goals>
                  <goal>install-artifact</goal>
                  <goal>deploy-artifact</goal>
                </goals>
                <configuration>
                  <enunciateArtifactId>java.xml.client.library</enunciateArtifactId>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.1.1</version>
            <executions>
              <execution>
                <id>compile-cs</id>
                <phase>test-compile</phase>
                <goals>
                  <goal>exec</goal>
                </goals>
                <configuration>
                  <!--compile the nunit tests-->
                  <executable>${gmcs.executable}</executable>
                  <skip>${gmcs.executable}</skip>
                  <arguments>
                    <argument>${project.build.testSourceDirectory}/../cs/TestCSharpClient.cs</argument>
                    <argument>/out:${project.build.directory}/cstests/${project.artifactId}-tests.exe</argument>
                    <argument>/target:exe</argument>
                    <argument>/r:System.Web.Services</argument>
                    <argument>/r:${project.build.directory}/cstests/${project.artifactId}.dll</argument>
                  </arguments>
                  <workingDirectory>${project.build.directory}</workingDirectory>
                </configuration>
              </execution>
              <execution>
                <id>nunit</id>
                <phase>integration-test</phase>
                <goals>
                  <goal>exec</goal>
                </goals>
                <configuration>
                  <!--compile the nunit tests-->
                  <executable>mono</executable>
                  <skip>${gmcs.executable}</skip>
                  <arguments>
                    <argument>${project.build.directory}/cstests/${project.artifactId}-tests.exe</argument>
                  </arguments>
                  <workingDirectory>${project.build.directory}</workingDirectory>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <!--as part of the tests, we're going to make sure the c and obj-c code compiles.-->
                <id>compile-obj-c</id>
                <phase>test-compile</phase>
                <configuration>
                  <tasks>
                    <property name="gcc.executable" value="${gcc.executable}"/>
                    <property name="libxml.config.executable" value="${libxml.config.executable}"/>
                    <property name="gnustep.config.executable" value="${gnustep.config.executable}"/>
                    <property name="project.build.directory" value="${project.build.directory}"/>

                    <ant antfile="${basedir}/gcc-compile.xml">
                      <target name="gcc"/>
                    </ant>
                  </tasks>
                </configuration>
                <goals>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <executions>
              <execution>
                <id>default-testCompile</id>
                <phase>test-compile</phase>
                <goals>
                  <goal>testCompile</goal>
                </goals>
                <configuration>
                  <skip>false</skip>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <!-- skip unit test run, tests to be executed during integration-test -->
              <skip>true</skip>
            </configuration>
            <executions>
              <execution>
                <id>surefire-it</id>
                <phase>integration-test</phase>
                <goals>
                  <goal>test</goal>
                </goals>
                <configuration>
                  <skip>${skipTests}</skip>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-maven2-plugin</artifactId>
            <executions>
              <execution>
                <id>start-container</id>
                <phase>pre-integration-test</phase>
                <goals>
                  <goal>start</goal>
                </goals>
              </execution>
              <execution>
                <id>stop-container</id>
                <phase>post-integration-test</phase>
                <goals>
                  <goal>stop</goal>
                </goals>
              </execution>
            </executions>
            <configuration>
              <skip>${skipTests}</skip>
              <container>
                <containerId>tomcat7x</containerId>
                <zipUrlInstaller>
                  <url>http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.79/bin/apache-tomcat-7.0.79.zip</url>
                  <extractDir>${basedir}/cargo-installs</extractDir>
                </zipUrlInstaller>
                <append>false</append>
              </container>
              <deployables>
                <deployable>
                  <properties>
                    <context>full</context>
                  </properties>
                </deployable>
              </deployables>
              <configuration>
                <properties>
                  <!--<cargo.jvmargs>-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005</cargo.jvmargs>-->
                </properties>
                <home>${project.build.directory}/tomcat-config</home>
              </configuration>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
