<?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">

	<!-- 
	
	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.
	
	 -->

	<modelVersion>4.0.0</modelVersion>

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

	<groupId>org.ops4j.pax.web</groupId>
	<artifactId>pax-web-features</artifactId>
	<packaging>pom</packaging>

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

	<description>
    Pax Web module creating a features xml file to deploy Pax Web components as features in Apache Karaf.
    To use this feature enter the following in your Karaf shell -
    features:install mvn:org.ops4j.pax.web/features/${project.version}/xml/features
  </description>

	<properties>
        <geronimo.jta-spec.version>1.1.1</geronimo.jta-spec.version>
		<javax.annotation.version>1.3</javax.annotation.version>
        <geronimo.jaspic-spec.version>1.1</geronimo.jaspic-spec.version>
		<geronimo.servlet.version>1.1.2</geronimo.servlet.version>
        <javax.mail.version>1.4.7</javax.mail.version>
		<pax.url.version>${dependency.paxurl.version}</pax.url.version>
        <servicemix.specs.version>2.9.0</servicemix.specs.version>
        <dependency.websocket.bundle.version>1.1_1</dependency.websocket.bundle.version>
        <dependency.alpn.version>1.1.2.v20150522</dependency.alpn.version>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.apache.karaf.features</groupId>
			<artifactId>framework</artifactId>
			<version>${dependency.karaf.version}</version>
			<type>kar</type>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.ops4j.pax.web</groupId>
			<artifactId>pax-web-jetty</artifactId>
		</dependency>
		<dependency>
			<groupId>org.ops4j.pax.web</groupId>
			<artifactId>pax-web-tomcat</artifactId>
		</dependency>
		<dependency>
			<groupId>org.ops4j.pax.web</groupId>
			<artifactId>pax-web-undertow</artifactId>
		</dependency>
		<dependency>
			<groupId>org.eclipse.jetty</groupId>
			<artifactId>jetty-continuation</artifactId>
			<version>${dependency.jetty.version}</version>
			<scope>provided</scope>
		</dependency>
	</dependencies>

	<build>
		<resources>
			<resource>
				<directory>src/main/resources</directory>
				<filtering>true</filtering>
			</resource>
		</resources>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<execution>
						<id>copy</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>copy-dependencies</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<executions>
					<execution>
						<id>filter</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>resources</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.karaf.tooling</groupId>
				<artifactId>karaf-maven-plugin</artifactId>
				<version>${dependency.karaf.version}</version>
				<executions>
					<execution>
						<id>verify</id>
						<phase>process-resources</phase>
						<goals>
							<goal>verify</goal>
						</goals>
						<configuration>
							<descriptors>
								<descriptor>mvn:org.apache.karaf.features/framework/${dependency.karaf.version}/xml/features</descriptor>
								<descriptor>mvn:org.apache.karaf.features/standard/${dependency.karaf.version}/xml/features</descriptor>
								<descriptor>mvn:org.apache.karaf.features/enterprise/${dependency.karaf.version}/xml/features</descriptor>
								<descriptor>mvn:org.ops4j.pax.keycloak/pax-keycloak-features/${dependency.pax-keycloak.version}/xml/features</descriptor>
								<descriptor>file:${project.build.directory}/classes/features.xml</descriptor>
							</descriptors>
							<blacklistedDescriptors>
								<!-- we don't want to transitively use any pax-web-features - only the one specified above using file:// -->
								<!-- mvn:${project.groupId}/${project.artifactId} is blacklisted implicitly -->
								<descriptor>mvn:org.ops4j.pax.web/pax-web-features</descriptor>
							</blacklistedDescriptors>
							<distribution>org.apache.karaf.features:framework</distribution>
							<javase>1.8</javase>
							<framework>
								<feature>framework</feature>
							</framework>
							<features>
								<!-- We can't use pax-* as we need to disable pax-jsf-support
								<feature>pax-*</feature>
								-->
								<feature>pax-http</feature>
								<feature>pax-http-whiteboard</feature>
								<feature>pax-war</feature>
								<feature>pax-jetty</feature>
<!-- 								<feature>pax-jetty-spdy</feature> -->
								<feature>pax-http-jetty</feature>
								<!-- pax-cdi does not validate correctly
								<feature>pax-jsf-support</feature>
								-->
								<feature>pax-tomcat</feature>
								<feature>pax-http-tomcat</feature>
								<feature>pax-undertow</feature>
								<feature>pax-http-undertow</feature>
							</features>
							<verifyTransitive>false</verifyTransitive>
							<ignoreMissingConditions>true</ignoreMissingConditions>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>attach-artifacts</id>
						<phase>package</phase>
						<goals>
							<goal>attach-artifact</goal>
						</goals>
						<configuration>
							<artifacts>
								<artifact>
									<file>${project.build.outputDirectory}/features.xml</file>
									<type>xml</type>
									<classifier>features</classifier>
								</artifact>
								<artifact>
									<file>${project.build.outputDirectory}/jetty.xml</file>
									<type>xml</type>
									<classifier>jettyconfig</classifier>
								</artifact>
								<artifact>
									<file>${project.build.outputDirectory}/undertow.properties</file>
									<type>properties</type>
									<classifier>undertowconfig</classifier>
								</artifact>
								<artifact>
									<file>${project.build.outputDirectory}/undertow.xml</file>
									<type>xml</type>
									<classifier>undertowconfig</classifier>
								</artifact>
                            </artifacts>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
		</plugins>
	</build>

</project>
