<?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>
		<relativePath>../pom.xml</relativePath>
		<groupId>org.ops4j.pax</groupId>
		<artifactId>web</artifactId>
		<version>4.2.8</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>
<!--         <geronimo.annotation-spec.version>1.0.1</geronimo.annotation-spec.version> -->
		<javax.annotation.version>1.2</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.4</javax.mail.version>
		<pax.url.version>${dependency.paxurl.version}</pax.url.version>
        <servicemix.specs.version>2.5.0</servicemix.specs.version>
        <dependency.servicemix-asm.version>3.3_2</dependency.servicemix-asm.version>
        <aries.spifly.version>1.0.1</aries.spifly.version>
        <dependency.websocket.version>1.1</dependency.websocket.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.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>file:${project.build.directory}/classes/features.xml</descriptor>
							</descriptors>
							<distribution>org.apache.karaf.features:framework</distribution>
							<javase>1.7</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-war-tomcat</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>target/classes/features.xml</file>
									<type>xml</type>
									<classifier>features</classifier>
								</artifact>
                                <artifact>
                                    <file>src/main/resources/jetty.xml</file>
                                    <type>xml</type>
                                    <classifier>jettyconfig</classifier>
                                </artifact>
                            </artifacts>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
		</plugins>
	</build>

</project>
