<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright 2021 OPS4J.

    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 https://maven.apache.org/xsd/maven-4.0.0.xsd">

	<modelVersion>4.0.0</modelVersion>

	<parent>
		<groupId>org.ops4j.pax.web.samples</groupId>
		<artifactId>samples-war</artifactId>
		<version>11.1.2</version>
		<relativePath>../../pom.xml</relativePath>
	</parent>

	<groupId>org.ops4j.pax.web.samples</groupId>
	<artifactId>the-wab-itself</artifactId>
	<packaging>war</packaging>

	<name>OPS4J Pax Web Complex WAR - the WAB</name>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<extensions>true</extensions>
				<configuration>
					<supportedProjectTypes>
						<supportedProjectType>jar</supportedProjectType>
						<supportedProjectType>war</supportedProjectType>
						<supportedProjectType>bundle</supportedProjectType>
					</supportedProjectTypes>
					<instructions>
						<Import-Package>
							<!-- OSGi Core R8+ -->
							org.osgi.framework;version="[1.10,2)",

							<!-- Servlet API 6.0+ (JakartaEE 10+) -->
							jakarta.servlet.*;version="[6,7)",

							<!--
								wiring to container-bundle-1, which is wired to container-bundle-3, which itself
								won't be wired directly to the-wab-itself
							-->
							org.ops4j.pax.web.samples.war.cb1.utils
						</Import-Package>
						<Private-Package>
							org.ops4j.pax.web.samples.war,
							org.ops4j.pax.web.samples.war.scis
						</Private-Package>
						<_wab>${project.build.directory}/${project.build.finalName}</_wab>
						<Web-ContextPath>/wab-complex</Web-ContextPath>
						<Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
						<Embed-Directory>WEB-INF/lib</Embed-Directory>
						<!--
							Explicit Include-Resource without {maven-resource} (which we get anyway from
							the extracter WAR) is needed to exclude /META-INF/services from the WAR. /META-INF/services
							will be available from /WEB-INF/classes/META-INF/services, so it'll be available
							from the classpath to respect ServiceLoader contract.
						-->
						<Include-Resource>
							{maven-dependencies}
						</Include-Resource>
					</instructions>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<dependencies>

		<!-- pax-web own artifacts -->

		<dependency>
			<groupId>org.ops4j.pax.web.samples</groupId>
			<artifactId>the-wab-jar</artifactId>
		</dependency>
		<dependency>
			<groupId>org.ops4j.pax.web.samples</groupId>
			<artifactId>container-bundle-1</artifactId>
			<scope>provided</scope>
		</dependency>

		<!-- JakartaEE -->

		<dependency>
			<groupId>jakarta.servlet</groupId>
			<artifactId>jakarta.servlet-api</artifactId>
			<scope>provided</scope>
		</dependency>

		<!-- Other -->

		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
		</dependency>
		<dependency>
			<groupId>commons-codec</groupId>
			<artifactId>commons-codec</artifactId>
			<scope>runtime</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.commons</groupId>
			<artifactId>commons-lang3</artifactId>
			<scope>provided</scope>
		</dependency>

	</dependencies>
</project>
