<?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/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>org.eclipse.jetty.its.jetty-run-distro-mojo-it</groupId>
    <artifactId>jetty-simple-project</artifactId>
    <version>0.0.1-SNAPSHOT</version>
  </parent>

  <artifactId>jetty-simple-webapp</artifactId>
  <packaging>war</packaging>

  <name>Jetty :: Simple :: Webapp</name>

  <properties>
    <jetty.port.file>${project.build.directory}/jetty-run-distro-port.txt</jetty.port.file>
    <jetty.jvmArgs>@jetty.jvmArgs@</jetty.jvmArgs>
  </properties>

  <dependencies>

    <dependency>
      <groupId>org.eclipse.jetty.its.jetty-run-distro-mojo-it</groupId>
      <artifactId>jetty-simple-base</artifactId>
    </dependency>

    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-servlet</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-maven-plugin</artifactId>
      <classifier>tests</classifier>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <build>

    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-war-plugin</artifactId>
          <configuration>
            <failOnMissingWebXml>false</failOnMissingWebXml>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <systemPropertyVariables>
            <jetty.port.file>${jetty.port.file}</jetty.port.file>
            <pingServlet>true</pingServlet>
            <helloServlet>true</helloServlet>
            <maven.it.name>${project.groupId}:${project.artifactId}</maven.it.name>
          </systemPropertyVariables>
          <dependenciesToScan>
            <dependency>org.eclipse.jetty:jetty-maven-plugin</dependency>
          </dependenciesToScan>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-maven-plugin</artifactId>
        <configuration>
          <stopPort>@jetty.stopPort@</stopPort>
          <stopKey>@jetty.stopKey@</stopKey>
        </configuration>
        <executions>
          <execution>
            <id>start-jetty</id>
            <phase>test-compile</phase>
            <goals>
              <goal>run-distro</goal>
            </goals>
            <configuration>
              <jettyBase>${basedir}/src/base</jettyBase>
              <javaPath>${java.home}/bin/java</javaPath>
              <jettyProperties>
                <jettyProperty>jetty.server.dumpAfterStart=true</jettyProperty>
                <jettyProperty>jetty.port.file=${jetty.port.file}</jettyProperty>
                <jettyProperty>jetty.http.port=0</jettyProperty>
              </jettyProperties>
              <waitForChild>false</waitForChild>
              <modules>
                <module>jsp</module>
                <module>jstl</module>
                <module>testmod</module>
              </modules>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

</project>
