<!--
  #%L
  %%
  Copyright (C) 2011 - 2017 BMW Car IT GmbH
  %%
  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.
  #L%
  -->

<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/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<groupId>io.joynr.java.messaging.bounceproxy</groupId>
	<artifactId>single-bounceproxy</artifactId>
	<packaging>war</packaging>

	<name>${project.groupId}:${project.artifactId}</name>

	<parent>
		<groupId>io.joynr.java.messaging</groupId>
		<artifactId>bounceproxy</artifactId>
		<version>1.3.0</version>
		<relativePath>../pom.xml</relativePath>
	</parent>

	<dependencies>
		<!--
		ATTENTION: Whenever dependencies are changed (including version updates),
		the disclaimer in src/main/resources/WEB-INF/DISCLAIMER must be adapted
		accordingly.
		-->
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-log4j12</artifactId>
		</dependency>
		<dependency>
			<groupId>com.sun.jersey.contribs</groupId>
			<artifactId>jersey-multipart</artifactId>
		</dependency>
		<dependency>
			<groupId>eu.infomas</groupId>
			<artifactId>annotation-detector</artifactId>
			<version>3.0.0</version>
		</dependency>
		<dependency>
			<groupId>io.joynr.smrf.java</groupId>
			<artifactId>smrf</artifactId>
			<version>${smrf.version}</version>
		</dependency>
		<dependency>
			<groupId>org.jboss.spec</groupId>
			<artifactId>jboss-javaee-6.0</artifactId>
			<version>1.0.0.Final</version>
			<type>pom</type>
			<scope>provided</scope>
			<exclusions>
				<exclusion>
					<artifactId>jsf-api</artifactId>
					<groupId>com.sun.faces</groupId>
				</exclusion>
				<exclusion>
					<artifactId>jstl</artifactId>
					<groupId>javax.servlet</groupId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>com.jayway.restassured</groupId>
			<artifactId>rest-assured</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>io.joynr.java.messaging.bounceproxy</groupId>
			<artifactId>bounceproxy-common</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>io.joynr.java.messaging</groupId>
			<artifactId>messaging-service</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>io.joynr.java.messaging</groupId>
			<artifactId>channel-service</artifactId>
			<version>${project.version}</version>
		</dependency>
	</dependencies>

	<build>
		<finalName>${project.artifactId}</finalName>

		<resources>
			<resource>
				<directory>src/main/resources</directory>
				<filtering>true</filtering>
			</resource>
		</resources>

		<plugins>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>properties-maven-plugin</artifactId>
				<executions>
					<execution>
						<goals>
							<goal>set-system-properties</goal>
						</goals>
						<configuration>
							<properties>
								<property>
									<name>log4j.configuration</name>
									<value>file:${basedir}/src/main/resources/WEB-INF/classes/log4j.properties</value>
								</property>
							</properties>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.eclipse.jetty</groupId>
				<artifactId>jetty-maven-plugin</artifactId>
				<dependencies>
					<dependency>
						<groupId>org.slf4j</groupId>
						<artifactId>slf4j-log4j12</artifactId>
						<version>1.6.6</version>
					</dependency>
				</dependencies>
				<configuration>
					<!--
					Don't define system properties here, because it will override system
					properties defined in plugin management in super POM.
					-->
					<webApp>
						<contextPath>/bounceproxy</contextPath>
						<descriptor>src/main/resources/WEB-INF/web.xml</descriptor>
					</webApp>
					<!--
					This "override" is needed to disable contextHandlers defined in plugin
					management in super POM.
					-->
					<contextHandlers combine.self="override"></contextHandlers>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-resources-plugin</artifactId>
				<executions>
					<execution>
						<id>copy-notice-license-to-bounceproxy-war</id>
						<phase>prepare-package</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>
							<skip>${skip.copy-notice-and-license-files}</skip>
							<outputDirectory>${project.build.directory}/${project.build.finalName}</outputDirectory>
							<resources>
								<resource>
									<directory>${basedir}</directory>
									<includes>
										<include>NOTICE*</include>
										<include>*LICENSE*</include>
									</includes>
								</resource>
								<resource>
									<directory>${project.build.directory}</directory>
									<includes>
										<include>LICENSE</include>
									</includes>
								</resource>
							</resources>
						</configuration>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<configuration>
					<webXml>${basedir}/src/main/resources/WEB-INF/web.xml</webXml>
					<warName>${project.build.finalName}</warName>
					<warSourceDirectory>src/main/resources</warSourceDirectory>
					<attachClasses>true</attachClasses>
					<overlays>
						<overlay>
							<groupId>io.joynr.java.messaging</groupId>
							<artifactId>channel-service</artifactId>
							<type>jar</type>
							<includes>
								<include>css/**</include>
								<include>script/**</include>
								<include>channels.html</include>
								<include>NOTICE-javascript</include>
								<include>MIT-LICENSE</include>
								<include>LICENSE_INFO</include>
							</includes>
						</overlay>
					</overlays>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<execution>
						<phase>package</phase>
						<goals>
							<goal>copy</goal>
						</goals>
						<configuration>
							<artifactItems>
								<artifactItem>
									<groupId>org.eclipse.jetty</groupId>
									<artifactId>jetty-runner</artifactId>
									<version>${jetty.version}</version>
									<destFileName>jetty-runner.jar</destFileName>
								</artifactItem>
								<artifactItem>
									<groupId>org.eclipse.jetty.websocket</groupId>
									<artifactId>websocket-server</artifactId>
									<version>${jetty.version}</version>
									<destFileName>websocket-server.jar</destFileName>
								</artifactItem>
							</artifactItems>
						</configuration>
					</execution>
				</executions>
			</plugin>

		</plugins>

		<pluginManagement>
			<plugins>
				<!-- This plugin allows the single goal: assembly:single to create a
					singe distributable tar.gz file -->
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-assembly-plugin</artifactId>
					<version>2.3</version>
				</plugin>
				<!--This plugin's configuration is used to store Eclipse m2e settings
					only. It has no influence on the Maven build itself. -->
				<plugin>
					<groupId>org.eclipse.m2e</groupId>
					<artifactId>lifecycle-mapping</artifactId>
					<version>1.0.0</version>
					<configuration>
						<lifecycleMappingMetadata>
							<pluginExecutions>
								<pluginExecution>
									<pluginExecutionFilter>
										<groupId>org.codehaus.mojo</groupId>
										<artifactId>properties-maven-plugin</artifactId>
										<versionRange>[1.0-alpha-2,)</versionRange>
										<goals>
											<goal>set-system-properties</goal>
										</goals>
									</pluginExecutionFilter>
									<action>
										<ignore />
									</action>
								</pluginExecution>
							</pluginExecutions>
						</lifecycleMappingMetadata>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
</project>
