<?xml version="1.0" encoding="UTF-8"?>
<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>originals-parent</artifactId>
    <groupId>io.github.davidwhitlock.cs410J</groupId>
    <version>2022.0.0</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <groupId>io.github.davidwhitlock.cs410J.original</groupId>
  <artifactId>apptbook-web</artifactId>

  <properties>
    <jetty.http.port>8080</jetty.http.port>
  </properties>

  <packaging>war</packaging>
  <version>2022.0.0</version>
  <name>Appointment Book Web/REST Project</name>
  <url>http://maven.apache.org</url>
  <dependencies>
    <dependency>
      <groupId>io.github.davidwhitlock.cs410J</groupId>
      <artifactId>projects</artifactId>
      <version>2022.0.0</version>
    </dependency>
    <dependency>
      <groupId>io.github.davidwhitlock.cs410J</groupId>
      <artifactId>examples</artifactId>
      <version>2022.0.0</version>
    </dependency>
    <dependency>
      <groupId>io.github.davidwhitlock.cs410J</groupId>
      <artifactId>projects</artifactId>
      <version>2022.0.0</version>
      <classifier>tests</classifier>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <version>4.0.1</version>
    </dependency>
  </dependencies>
  <build>
    <finalName>apptbook</finalName>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>${surefire.version}</version>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>${build-helper-maven-plugin.version}</version>
      </plugin>
      <plugin>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-maven-plugin</artifactId>
        <version>${jetty-maven-plugin.version}</version>
        <configuration>
          <httpConnector>
            <port>${jetty.http.port}</port>
          </httpConnector>
          <stopKey>stop-key</stopKey>
          <stopPort>9999</stopPort>
          <webApp>
            <contextPath>/${project.build.finalName}</contextPath>
          </webApp>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.cargo</groupId>
        <artifactId>cargo-maven2-plugin</artifactId>
        <version>1.6.7</version>
        <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>
          <container>
            <containerId>jetty9x</containerId>
            <type>embedded</type>
            <systemProperties>
              <org.apache.commons.logging.Log>org.apache.commons.logging.impl.SimpleLog</org.apache.commons.logging.Log>
            </systemProperties>
          </container>
          <configuration>
            <properties>
              <cargo.servlet.port>${jetty.http.port}</cargo.servlet.port>
            </properties>
          </configuration>
          <deployables>
            <deployable>
              <location>${project.build.directory}/${project.build.finalName}.${project.packaging}</location>
              <pingURL>http://localhost:${jetty.http.port}/${project.build.finalName}/index.html</pingURL>
              <pingTimeout>20000</pingTimeout>
            </deployable>
          </deployables>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>${maven-jar-plugin.version}</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <classifier>client</classifier>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <archive>
            <manifest>
              <addClasspath>true</addClasspath>
              <classpathLayoutType>repository</classpathLayoutType>
              <classpathPrefix>file:///${localRepositoryWithEscapedSpaces}</classpathPrefix>
              <mainClass>edu.pdx.cs410J.apptbookweb.Project4</mainClass>
            </manifest>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>${jacoco-maven-plugin.version}</version>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>grader</id>
      <activation>
        <activeByDefault>${grader}</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${maven.javadoc.plugin.version}</version>
            <configuration>
              <doclet>edu.pdx.cs410J.grader.APIDocumentationDoclet</doclet>
              <docletArtifact>
                <groupId>io.github.davidwhitlock.cs410J</groupId>
                <artifactId>grader</artifactId>
                <version>2022.0.0</version>
              </docletArtifact>
              <useStandardDocletOptions>false</useStandardDocletOptions>
              <show>private</show>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>${jacoco-maven-plugin.version}</version>
            <executions>
              <execution>
                <id>default-check</id>
                <goals>
                  <goal>check</goal>
                </goals>
                <configuration>
                  <haltOnFailure>${haltOnFailingCoverage}</haltOnFailure>
                  <rules>
                    <rule>
                      <element>BUNDLE</element>
                      <limits>
                        <limit>
                          <counter>INSTRUCTION</counter>
                          <value>COVEREDRATIO</value>
                          <minimum>${jacoco.min.instruction.covered.ratio}</minimum>
                        </limit>
                        <limit>
                          <counter>CLASS</counter>
                          <value>MISSEDCOUNT</value>
                          <maximum>${jacoco.max.missed.classes}</maximum>
                        </limit>
                      </limits>
                    </rule>
                  </rules>
                  <dataFile>${project.build.directory}/jacoco-merged.exec</dataFile>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
