<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (C) 2018-2022 Philip Helger (www.helger.com)
    philip[at]helger[dot]com

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

            http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<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>com.helger.as2</groupId>
    <artifactId>as2-lib-parent-pom</artifactId>
    <version>4.10.0</version>
  </parent>
  <artifactId>as2-demo-webapp</artifactId>
  <packaging>war</packaging>
  <name>as2-demo-webapp</name>
  <url>https://github.com/phax/as2-lib/as2-demo-webapp</url>
  <inceptionYear>2018</inceptionYear>
  
  <licenses>
    <license>
      <name>Apache 2</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <dependencies>
    <dependency>
      <groupId>com.helger.as2</groupId>
      <artifactId>as2-servlet</artifactId>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
    </dependency>

    <dependency>
      <groupId>com.sun.xml.bind</groupId>
      <artifactId>jaxb-impl</artifactId>
    </dependency>

    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <scope>provided</scope>
    </dependency>
    
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.helger.photon</groupId>
      <artifactId>ph-oton-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.helger.photon</groupId>
      <artifactId>ph-oton-jetty</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <resources>
      <resource>
        <directory>${basedir}/src/main/resources</directory>
        <targetPath>${project.build.directory}/classes</targetPath>
      </resource>
      <resource>
        <directory>${basedir}/src/main/webapp</directory>
        <targetPath>${project.build.directory}/webapp-classes</targetPath>
      </resource>
    </resources>
    
    <plugins>
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <executions>
          <execution>
            <id>bundle-manifest</id>
            <phase>process-classes</phase>
            <goals>
              <goal>manifest</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <supportedProjectTypes>
            <supportedProjectType>war</supportedProjectType>
          </supportedProjectTypes>
          <instructions>
            <_wab>src/main/webapp</_wab>
            <Import-Package>
              javax.servlet,javax.servlet.http,org.w3c.dom,org.xml.sax,org.xml.sax.ext,org.xml.sax.helpers,
              javax.xml.namespace,javax.crypto,javax.crypto.spec,javax.security.auth,
              javax.security.auth.x500,javax.xml.bind,org.slf4j,!*</Import-Package>
            <Bundle-ClassPath>
              WEB-INF/classes,
              WEB-INF/lib/activation-1.1.1.jar,
              WEB-INF/lib/as2-lib-4.4.3-SNAPSHOT.jar,
              WEB-INF/lib/as2-servlet-4.4.3-SNAPSHOT.jar,
              WEB-INF/lib/bcmail-jdk15on-1.62.jar,
              WEB-INF/lib/bcpkix-jdk15on-1.62.jar,
              WEB-INF/lib/bcprov-jdk15on-1.62.jar,
              WEB-INF/lib/commons-codec-1.10.jar,
              WEB-INF/lib/commons-logging-1.2.jar,
              WEB-INF/lib/httpclient-4.5.8.jar,
              WEB-INF/lib/httpcore-4.4.11.jar,
              WEB-INF/lib/javax.mail-1.6.2.jar,
              WEB-INF/lib/jsr305-3.0.2.jar,
              WEB-INF/lib/ph-bc-9.3.6.jar,
              WEB-INF/lib/ph-collection-9.3.6.jar,
              WEB-INF/lib/ph-commons-9.3.6.jar,
              WEB-INF/lib/ph-datetime-9.3.6.jar,
              WEB-INF/lib/ph-http-9.1.2.jar,
              WEB-INF/lib/ph-mail-9.1.2.jar,
              WEB-INF/lib/ph-network-9.1.2.jar,
              WEB-INF/lib/ph-scopes-9.3.6.jar,
              WEB-INF/lib/ph-security-9.3.6.jar,
              WEB-INF/lib/ph-servlet-9.1.2.jar,
              WEB-INF/lib/ph-useragent-9.1.2.jar,
              WEB-INF/lib/ph-web-9.1.2.jar,
              WEB-INF/lib/ph-xml-9.3.6.jar,
              WEB-INF/lib/ph-xservlet-9.1.2.jar,
              WEB-INF/lib/slf4j-api-1.7.26.jar
            </Bundle-ClassPath>
            <Web-ContextPath>/demo</Web-ContextPath>
          </instructions>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-war-plugin</artifactId>
        <executions>
          <execution>
            <id>default-war</id>
            <phase>package</phase>
            <goals>
              <goal>war</goal>
            </goals>
            <configuration>
              <archive>
                <manifestFile>${project.build.directory}/classes/META-INF/MANIFEST.MF</manifestFile>
                <manifest>
                  <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                </manifest>
              </archive>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <archive>
            <manifestFile>${project.build.directory}/classes/META-INF/MANIFEST.MF</manifestFile>
            <manifest>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
            </manifest>
          </archive>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
