<?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 http://maven.apache.org/maven-v4_0_0.xsd">

	<modelVersion>4.0.0</modelVersion>

	<parent>
		<groupId>org.ops4j.pax</groupId>
		<artifactId>web</artifactId>
		<version>8.0.30</version>
		<relativePath>../pom.xml</relativePath>
	</parent>

	<groupId>org.ops4j.pax.web</groupId>
	<artifactId>pax-web-runtime</artifactId>
	<packaging>bundle</packaging>

	<name>OPS4J Pax Web - Runtime</name>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<extensions>true</extensions>
				<configuration>
					<instructions>
						<Bundle-Activator>org.ops4j.pax.web.service.internal.Activator</Bundle-Activator>
						<Import-Package>
							<!-- ranges indicate Servlet API 3.1+ (JavaEE 7+) -->
							javax.servlet;version="[3.1,5)",
							javax.servlet.annotation;version="[3.1,5)",
							javax.servlet.descriptor;version="[3.1,5)",
							javax.servlet.http;version="[3.1,5)",

							<!-- ranges indicate we can work with OSGi Core R6+ -->
							org.osgi.framework;version="[1.8,2)",
							org.osgi.framework.dto;version="[1.0,2)",
							org.osgi.framework.wiring;version="[1.2,2)",
							org.osgi.util.tracker;version="[1.5,2)",

							<!-- OSGi cmpn -->
							org.osgi.service.cm;version="[1.0,2.0)";resolution:=optional,
							org.osgi.service.event;resolution:=optional,
							org.osgi.service.http;version="[1.2,2)",
							org.osgi.service.http.context;version="[1.1,2)",
							org.osgi.service.http.runtime;version="[1.1,2)",
							org.osgi.service.http.runtime.dto;version="[1.1,2)",

							<!-- from pax-web-api -->
							org.ops4j.pax.web.service;version="${pax-web.osgi.version}",
							org.ops4j.pax.web.service.views;version="${pax-web.osgi.version}",
							org.ops4j.pax.web.service.whiteboard;version="${pax-web.osgi.version}",
							org.ops4j.pax.web.utils;version="${pax-web.osgi.version}",

							<!-- from pax-web-spi -->
							org.ops4j.pax.web.service.spi;version="${pax-web.osgi.version}",
							org.ops4j.pax.web.service.spi.config;version="${pax-web.osgi.version}",
							org.ops4j.pax.web.service.spi.context;version="${pax-web.osgi.version}",
							org.ops4j.pax.web.service.spi.model;version="${pax-web.osgi.version}",
							org.ops4j.pax.web.service.spi.model.elements;version="${pax-web.osgi.version}",
							org.ops4j.pax.web.service.spi.model.events;version="${pax-web.osgi.version}",
							org.ops4j.pax.web.service.spi.model.info;version="${pax-web.osgi.version}",
							org.ops4j.pax.web.service.spi.model.views;version="${pax-web.osgi.version}",
							org.ops4j.pax.web.service.spi.util;version="${pax-web.osgi.version}",
							org.ops4j.pax.web.service.spi.servlet;version="${pax-web.osgi.version}",
							org.ops4j.pax.web.service.spi.task;version="${pax-web.osgi.version}",
							org.ops4j.pax.web.service.spi.whiteboard;version="${pax-web.osgi.version}",

							<!-- from pax-web-tomcat-common / tomcat-api -->
							org.apache.tomcat;version="${dependency.org.apache.tomcat}",
							<!-- from pax-web-tomcat-common / tomcat-util -->
							org.apache.tomcat.util;version="${dependency.org.apache.tomcat}",
							org.apache.tomcat.util.buf;version="${dependency.org.apache.tomcat}",
							org.apache.tomcat.util.compat;version="${dependency.org.apache.tomcat}",
							org.apache.tomcat.util.file;version="${dependency.org.apache.tomcat}",
							org.apache.tomcat.util.res;version="${dependency.org.apache.tomcat}",
							org.apache.tomcat.util.security;version="${dependency.org.apache.tomcat}",
							<!-- from pax-web-tomcat-common / tomcat-util-scan -->
							org.apache.tomcat.util.descriptor;version="${dependency.org.apache.tomcat}",
							org.apache.tomcat.util.descriptor.web;version="${dependency.org.apache.tomcat}",
							org.apache.tomcat.util.digester;version="${dependency.org.apache.tomcat}",

							<!-- from pax-logging-api -->
							org.slf4j;version="[1.7,2)",
							org.osgi.service.log;version="[1.3,2)",

							<!-- other required packages -->
							javax.xml.parsers,
							org.w3c.dom,
							org.xml.sax,

							org.jasypt.commons;resolution:=optional,
							org.jasypt.encryption;resolution:=optional,
							org.jasypt.encryption.pbe;resolution:=optional,
							org.jasypt.encryption.pbe.config;resolution:=optional

							<!-- to check after restoring previous functionality -->
<!--							javax.crypto.spec;resolution:=optional,-->
<!--							javax.crypto;resolution:=optional-->
						</Import-Package>
						<!-- Nothing is exported from pax-web-runtime -->
						<Provide-Capability>
							<!-- 140.12.1 osgi.implementation Capability -->
							osgi.implementation;osgi.implementation="osgi.http";version:Version="1.1";uses:="javax.servlet,javax.servlet.http,org.osgi.service.http.context,org.osgi.service.http.whiteboard",
							<!--
								140.12.2 osgi.contract Capability - pax-web-runtime does NOT export javax.servlet.* packages...
								https://docs.osgi.org/reference/portable-java-contracts.html
							-->
<!--							osgi.contract;osgi.contract=JavaServlet;version:Version="${dependency.jakarta.servlet-api}";uses:="javax.servlet,javax.servlet.http,javax.servlet.descriptor,javax.servlet.annotation",-->
<!--							osgi.contract;osgi.contract=JavaWebSockets;version:Version="1";uses:="javax.websocket,javax.websocket.server"-->
							<!-- 140.12.3 osgi.service Capability (135.4 osgi.service Namespace) -->
							osgi.service;objectClass:List&lt;String&gt;="org.osgi.service.http.runtime.HttpServiceRuntime";uses:="org.osgi.service.http.runtime,org.osgi.service.http.runtime.dto",
							<!--
								Not specified in 102 Http Service, but declared by pax-web-runtime.
								OSGi Core R7, 10.3.3.5 public static final String EFFECTIVE_ACTIVE = "active"
							-->
							osgi.service;effective:=active;objectClass:List&lt;String&gt;="org.osgi.service.http.HttpService,org.ops4j.pax.web.service.WebContainer"
						</Provide-Capability>
						<Require-Capability>
							<!-- ServerControllerFactory services are registered by pax-web-jetty, pax-web-tomcat and pax-web-undertow -->
							osgi.service;effective:=active;filter:="(objectClass=org.ops4j.pax.web.service.spi.ServerControllerFactory)"
						</Require-Capability>
						<Embed-Dependency>
							ops4j-base-lang;inline=true,
							ops4j-base-util-collections;inline=true,
							ops4j-base-util-property;inline=true,
							ops4j-base-util-xml;inline=true,
							pax-swissbox-property;inline=true,
						</Embed-Dependency>
<!--						<_dsannotations>*</_dsannotations>-->
<!--						<_dsannotations-options>norequirements,nocapabilities,version;minimum=0.1</_dsannotations-options>-->
					</instructions>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<dependencies>

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

		<dependency>
			<groupId>org.ops4j.pax.web</groupId>
			<artifactId>pax-web-api</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.ops4j.pax.web</groupId>
			<artifactId>pax-web-spi</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.ops4j.pax.web</groupId>
			<artifactId>pax-web-tomcat-common</artifactId>
			<scope>provided</scope>
		</dependency>

		<!-- OPS4J dependencies -->

		<dependency>
			<groupId>org.ops4j.base</groupId>
			<artifactId>ops4j-base-lang</artifactId>
		</dependency>
		<dependency>
			<groupId>org.ops4j.base</groupId>
			<artifactId>ops4j-base-util-xml</artifactId>
		</dependency>
		<dependency>
			<groupId>org.ops4j.base</groupId>
			<artifactId>ops4j-base-util-collections</artifactId>
		</dependency>
		<dependency>
			<groupId>org.ops4j.base</groupId>
			<artifactId>ops4j-base-util-property</artifactId>
		</dependency>
		<dependency>
			<groupId>org.ops4j.pax.swissbox</groupId>
			<artifactId>pax-swissbox-property</artifactId>
		</dependency>

		<!-- OSGi -->

		<dependency>
			<groupId>org.osgi</groupId>
			<artifactId>osgi.core</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.osgi</groupId>
			<artifactId>osgi.cmpn</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.osgi</groupId>
			<artifactId>osgi.annotation</artifactId>
			<scope>provided</scope>
		</dependency>

		<!-- JavaEE -->

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

		<!-- Logging -->

		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.logging.log4j</groupId>
			<artifactId>log4j-slf4j-impl</artifactId>
			<scope>test</scope>
		</dependency>

		<!-- Tomcat -->

		<!--
			We need these dependencies, but at runtime, the relevant classes/packages will be used
			from pax-web-tomcat-common
		-->
		<dependency>
			<groupId>org.apache.tomcat</groupId>
			<artifactId>tomcat-util-scan</artifactId>
			<scope>provided</scope>
		</dependency>

		<!-- Other -->

		<dependency>
			<groupId>org.jasypt</groupId>
			<artifactId>jasypt</artifactId>
			<optional>true</optional>
		</dependency>

		<!-- Testing -->

		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.mockito</groupId>
			<artifactId>mockito-core</artifactId>
			<scope>test</scope>
		</dependency>

	</dependencies>

</project>
