<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>
  <groupId>org.duracloud.mill</groupId>
  <artifactId>policy-editor</artifactId>
  <version>2.0.0</version>
  <name>Duplication Policy Editor</name>

  <parent>
    <artifactId>mill</artifactId>
    <groupId>org.duracloud.mill</groupId>
    <version>2.0.0</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <properties>
    <jetty.port>8888</jetty.port>
    <jetty.version>9.2.1.v20140609</jetty.version>
    <policyeditor.username>admin</policyeditor.username>
    <policyeditor.password>apw</policyeditor.password>
    <policyeditor.subdomain>danny</policyeditor.subdomain>
  </properties>
  
  <build>
      <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
        <filtering>true</filtering>
      </testResource>
    </testResources>

    <plugins>
      <plugin>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-maven-plugin</artifactId>
        <version>${jetty.version}</version>
        <configuration>
          <scanIntervalSeconds>10</scanIntervalSeconds>
          <systemProperties>
            <systemProperty>
              <name>jetty.port</name>
              <value>${jetty.port}</value>
            </systemProperty>
          </systemProperties>
          <webApp>
           <contextPath>/</contextPath>
          </webApp>
          <webAppConfig>
            <unpackOverlays>true</unpackOverlays>
          </webAppConfig>
          <stopKey>foo</stopKey>
          <stopPort>9999</stopPort>
        </configuration>
        <executions>
          <execution>
            <id>start-jetty</id>
            <phase>pre-integration-test</phase>
            <goals>
              <goal>start</goal>
            </goals>
            <configuration>
              <skip>${skipITs}</skip>
              <scanIntervalSeconds>0</scanIntervalSeconds>
              <daemon>true</daemon>
              <systemProperties>
                <systemProperty>
                  <name>jetty.port</name>
                  <value>${jetty.port}</value>
                </systemProperty>
              </systemProperties>
            </configuration>
          </execution>
          <execution>
            <id>stop-jetty</id>
            <phase>post-integration-test</phase>
            <goals>
              <goal>stop</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>selenium-maven-plugin</artifactId>
        <version>2.3</version>
        <executions>
          <execution>
            <id>xvfb</id>
             <phase>pre-integration-test</phase>
            <goals>
              <goal>xvfb</goal>
            </goals>
            <configuration>
               <skip>${skipITs}</skip>
            </configuration>
          </execution>
          <execution>
            <phase>pre-integration-test</phase>
            <goals>
              <goal>start-server</goal>
            </goals>
            <configuration>
              <background>true</background>
              <skip>${skipITs}</skip>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <!--
      <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>buildnumber-maven-plugin</artifactId>
          <version>1.1</version>
          <executions>
              <execution>
                  <phase>generate-resources</phase>
                  <goals>
                      <goal>create</goal>
                  </goals>
              </execution>
          </executions>
          <configuration>
              <doCheck>false</doCheck>
              <doUpdate>false</doUpdate>
              <shortRevisionLength>5</shortRevisionLength>
          </configuration>
      </plugin>
      -->
    </plugins>
  </build>

  <dependencies>

    <dependency>
      <groupId>org.duracloud.mill</groupId>
      <artifactId>common-dup</artifactId>
      <version>${project.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.10</version>
    </dependency>

    <dependency>
      <groupId>org.seleniumhq.selenium</groupId>
      <artifactId>selenium-java</artifactId>
      <version>2.37.0</version>
      <exclusions>
        <exclusion>
          <groupId>commons-logging</groupId>
          <artifactId>commons-logging</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
  </dependencies>
  
  <profiles>
  </profiles>
 </project>
