<?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">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.eclipse.jetty.demos</groupId>
    <artifactId>jetty-servlet5-demos</artifactId>
    <version>12.1.0.beta2</version>
  </parent>
  <artifactId>jetty-servlet5-demo-jetty-webapp</artifactId>
  <packaging>war</packaging>
  <name>Servlet 5 :: Demo :: Jetty WebApp</name>
  <properties>
    <bundle-symbolic-name>${project.groupId}.servlet5.jetty.webapp</bundle-symbolic-name>
  </properties>
  <dependencies>
    <dependency>
      <groupId>jakarta.annotation</groupId>
      <artifactId>jakarta.annotation-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>jakarta.servlet</groupId>
      <artifactId>jakarta.servlet-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>jakarta.servlet.jsp</groupId>
      <artifactId>jakarta.servlet.jsp-api</artifactId>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>jakarta.servlet.jsp.jstl</groupId>
      <artifactId>jakarta.servlet.jsp.jstl-api</artifactId>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <groupId>jakarta.el</groupId>
          <artifactId>jakarta.el-api</artifactId>
        </exclusion>
        <exclusion>
          <groupId>jakarta.servlet</groupId>
          <artifactId>jakarta.servlet-api</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-util</artifactId>
      <version>${project.version}</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <extensions>true</extensions>
        <configuration>
          <supportedProjectTypes>
            <supportedProjectType>war</supportedProjectType>
          </supportedProjectTypes>
          <instructions>
            <Import-Package>jakarta.servlet.jsp.*;version="3.0.0",org.eclipse.jetty.*;version="[$(version;===;${parsedVersion.osgiVersion}),$(version;==+;${parsedVersion.osgiVersion}))",*</Import-Package>
            <Export-Package>!org.example*</Export-Package>
            <!-- the test webapp is configured via a jetty xml file
            in order to add the security handler. -->
            <!-- in fact the '.' must not be there
            but Felix-BND has a bug:
            http://www.mail-archive.com/users@felix.apache.org/msg04730.html
            https://issues.apache.org/jira/browse/FELIX-1571
            -->
            <Bundle-ClassPath>.,WEB-INF/classes</Bundle-ClassPath>
            <Web-ContextPath>/servlet5-demo-jetty</Web-ContextPath>
          </instructions>
        </configuration>
        <executions>
          <execution>
            <id>ee10</id>
            <goals>
              <goal>manifest</goal>
            </goals>
            <configuration>
              <instructions>
                <Jetty-Environment>ee10</Jetty-Environment>
              </instructions>
              <manifestLocation>${project.build.outputDirectory}/META-INF-ee10</manifestLocation>
            </configuration>
          </execution>
          <execution>
            <id>ee11</id>
            <goals>
              <goal>manifest</goal>
            </goals>
            <configuration>
              <instructions>
                <Jetty-Environment>ee11</Jetty-Environment>
              </instructions>
              <manifestLocation>${project.build.outputDirectory}/META-INF-ee11</manifestLocation>
            </configuration>
          </execution>
          <execution>
            <id>ee9</id>
            <goals>
              <goal>manifest</goal>
            </goals>
            <configuration>
              <instructions>
                <Jetty-Environment>ee9</Jetty-Environment>
              </instructions>
              <manifestLocation>${project.build.outputDirectory}/META-INF-ee9</manifestLocation>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <id>ee10-web-bundle-assembly</id>
            <goals>
              <goal>single</goal>
            </goals>
            <phase>package</phase>
            <configuration>
              <descriptors>
                <descriptor>src/main/assembly/ee10-web-bundle.xml</descriptor>
              </descriptors>
              <archive>
                <manifestFile>${project.build.outputDirectory}/META-INF-ee10/MANIFEST.MF</manifestFile>
              </archive>
            </configuration>
          </execution>
          <execution>
            <id>ee11-web-bundle-assembly</id>
            <goals>
              <goal>single</goal>
            </goals>
            <phase>package</phase>
            <configuration>
              <descriptors>
                <descriptor>src/main/assembly/ee11-web-bundle.xml</descriptor>
              </descriptors>
              <archive>
                <manifestFile>${project.build.outputDirectory}/META-INF-ee11/MANIFEST.MF</manifestFile>
              </archive>
            </configuration>
          </execution>
          <execution>
            <id>ee9-web-bundle-assembly</id>
            <goals>
              <goal>single</goal>
            </goals>
            <phase>package</phase>
            <configuration>
              <descriptors>
                <descriptor>src/main/assembly/ee9-web-bundle.xml</descriptor>
              </descriptors>
              <archive>
                <manifestFile>${project.build.outputDirectory}/META-INF-ee9/MANIFEST.MF</manifestFile>
              </archive>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <excludes>
            <exclude>**/WebAppTest.java</exclude>
            <exclude>**/Test*.java</exclude>
          </excludes>
        </configuration>
        <executions>
          <execution>
            <id>test</id>
            <phase>test</phase>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <configuration>
          <archive>
            <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
          </archive>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
