<?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</groupId>
    <artifactId>it-parent-pom</artifactId>
    <version>0.0.1-SNAPSHOT</version>
  </parent>

  <groupId>org.eclipse.jetty.its.jetty-cdi-run-forked-mojo-it</groupId>
  <artifactId>jetty-weld-minimal</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>war</packaging>

  <properties>
    <jetty.port.file>${project.build.directory}/jetty-cdi-run-forked-port.txt</jetty.port.file>
  </properties>

  <dependencies>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-client</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-maven-plugin</artifactId>
      <classifier>tests</classifier>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <systemPropertyVariables>
            <jetty.port.file>${jetty.port.file}</jetty.port.file>
            <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>
        <executions>
          <execution>
            <id>start-jetty</id>
            <phase>test-compile</phase>
            <goals>
              <goal>run-forked</goal>
            </goals>
            <configuration>
              <nonBlocking>true</nonBlocking>
              <waitForChild>false</waitForChild>

              <!-- Set up configuration for Weld. -->
              <contextXml>${basedir}/src/main/jetty/jetty-context.xml</contextXml>
              <jettyXml>${basedir}/src/main/jetty/jetty.xml</jettyXml>
              <stopPort>@jetty.stopPort@</stopPort>
              <stopKey>@jetty.stopKey@</stopKey>

              <jvmArgs>${jetty.jvmArgs}</jvmArgs>
              <jettyProperties>
                <jettyProperty>jetty.port.file=${jetty.port.file}</jettyProperty>
              </jettyProperties>
            </configuration>
          </execution>
          <!--
          <execution>
            <id>stop-jetty</id>
            <phase>test</phase>
            <goals>
              <goal>stop</goal>
            </goals>
          </execution>
          -->
        </executions>
      </plugin>
    </plugins>
  </build>

</project>
