<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>
    <artifactId>project</artifactId>
    <groupId>org.mortbay.jetty</groupId>
    <version>6.1.26</version>
    <relativePath>../../pom.xml</relativePath>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.mortbay.jetty</groupId>
  <artifactId>jetty-test</artifactId>
  <packaging>war</packaging>
  <name>Jetty Test Webapp</name>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>clean</id>
            <phase>clean</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <tasks>
                <delete failonerror="false" includeemptydirs="true">
                  <fileset dir="../../webapps/test/" includes="**" />
                </delete>
                <delete failonerror="false" includeemptydirs="true">
                  <fileset dir="../../contexts/test.d/" includes="**" />
                </delete>
                <delete failonerror="false" file="../../contexts/test.xml"/>
              </tasks>
            </configuration>
          </execution>
          <execution>
            <phase>install</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <tasks>
                <delete quiet="true" dir="../../webapps/test/" />
                <copy failonerror="false" todir="../../webapps/test" >
                  <fileset dir="target/${project.artifactId}-${project.version}" includes="**" />
		</copy>
                <copy failonerror="false" todir="../../contexts">
                  <fileset dir="src/main/configuration" includes="**" />
                </copy>
		<chmod dir="../../webapps/test/cgi-bin" perm="ugo+rx" includes="**/*.sh" />
		<touch file="../../contexts/test.xml" mkdirs="true"/>
              </tasks>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <executions>
          <execution>
            <id>test</id>
            <phase>test</phase>
          </execution>
        </executions>
        <configuration>
          <excludes>
            <exclude>**/WebAppTest.java</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>maven-jetty-plugin</artifactId>
        <version>${project.version}</version>
        <configuration>
          <stopPort>8087</stopPort>
          <stopKey>foo</stopKey>
          <scanIntervalSeconds>1</scanIntervalSeconds>
          <!-- contextPath>/test</contextPath -->
          <systemProperties>
            <systemProperty>
              <name>fooprop</name>
              <value>222</value>
            </systemProperty>
          </systemProperties>
          <webAppConfig>
            <contextPath>/</contextPath>
            <tempDirectory>${project.build.directory}/work</tempDirectory>
            <sessionHandler implementation="org.mortbay.jetty.servlet.SessionHandler">
              <sessionManager implementation="org.mortbay.jetty.servlet.HashSessionManager">
                <storeDirectory>${basedir}/target/sessions</storeDirectory>
                <!-- savePeriod>5</savePeriod -->
              </sessionManager>
            </sessionHandler>
          </webAppConfig>
          <userRealms>
            <userRealm implementation="org.mortbay.jetty.security.HashUserRealm">
              <name>Test Realm</name>
              <config>../../etc/realm.properties</config>
            </userRealm>
          </userRealms>
        </configuration>
      </plugin>
      <!-- uncomment to precompile jsps -->
      <!--
      <plugin>
          <groupId>org.mortbay.jetty</groupId>
          <artifactId>maven-jetty-jspc-plugin</artifactId>
          <version>${project.version}</version>
          <executions>
            <execution>
              <id>jspc</id>
              <goals>
                <goal>jspc</goal>
              </goals>
              <configuration>
                 <includes>**/*.foo</includes>
                 <excludes>**/*.fff</excludes>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-war-plugin</artifactId>
          <configuration>
            <webXml>${basedir}/target/web.xml</webXml>
          </configuration>
       </plugin>
       -->
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>org.mortbay.jetty</groupId>
      <artifactId>jetty-client</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.mortbay.jetty</groupId>
      <artifactId>servlet-api</artifactId>
      <version>${servlet-version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>javax.servlet.jsp</groupId>
      <artifactId>jsp-api</artifactId>
      <version>2.1</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mortbay.jetty</groupId>
      <artifactId>jetty-servlet-tester</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mortbay.jetty</groupId>
      <artifactId>jetty</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>
