<?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">
	<parent>
		<artifactId>52n-sos</artifactId>
		<groupId>org.n52.sensorweb.sos</groupId>
		 <version>4.4.0-M6</version>
	</parent>
	<modelVersion>4.0.0</modelVersion>
	<artifactId>webapp-bundle</artifactId>
	<packaging>war</packaging>
	<name>52°North SOS - Webapp with Sensor Web REST API</name>
	<description>52°North SOS webapp with Sensor Web REST API</description>
	<properties>
		<timeseries.api.version>1.7.2</timeseries.api.version>
	</properties>
	<build>
		<finalName>${conf.sos.name}##${project.version}</finalName>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<execution>
						<id>rest-api</id>
						<phase>generate-resources</phase>
						<goals>
							<goal>unpack</goal>
						</goals>
						<configuration>
							<artifactItems>
								<artifactItem>
									<groupId>org.n52.sensorweb</groupId>
									<artifactId>timeseries-web</artifactId>
									<includes>api-doc/**</includes>
									<outputDirectory>${project.build.directory}/${project.build.finalName}/static/doc</outputDirectory>
									<overWrite>false</overWrite>
								</artifactItem>
							</artifactItems>
							<overWriteReleases>false</overWriteReleases>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<configuration>
					<filteringDeploymentDescriptors>true</filteringDeploymentDescriptors>
          <webResources>
            <resource>
                <directory>src/main/webapp</directory>
                <filtering>true</filtering>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
                <targetPath>WEB-INF/classes</targetPath>
            </resource>
          </webResources>
					<overlays>
						<overlay>
							<groupId>${project.groupId}</groupId>
							<artifactId>webapp</artifactId>
						</overlay>
					</overlays>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<configuration>
					<overlays>
						<overlay>
							<groupId>org.n52.sensorweb</groupId>
    						<artifactId>restful-timeseries-client</artifactId>
    						<excludes>
			                	<exclude>**/WEB-INF/**</exclude>
			                	<exclude>**/META-INF/**</exclude>
			                	<exclude>settings.json</exclude>
			              	</excludes>
			              	<targetPath>static/client/jsClient</targetPath>
						</overlay>
					</overlays>
				</configuration>
			</plugin>
		</plugins>
	</build>
	<dependencies>
		<!-- REST API Dependencies -->
		<dependency>
			<groupId>org.n52.sensorweb</groupId>
			<artifactId>timeseries-web</artifactId>
			<version>${timeseries.api.version}</version>
			<exclusions>
				<exclusion>
					<groupId>org.geotools</groupId>
					<artifactId>gt-main</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.geotools</groupId>
					<artifactId>gt-epsg-hsql</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.geotools</groupId>
					<artifactId>gt-opengis</artifactId>
				</exclusion>
				<exclusion>
					<groupId>org.geotools</groupId>
					<artifactId>gt-metadata</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.geotools</groupId>
			<artifactId>gt-main</artifactId>
		</dependency>
		<dependency>
			<groupId>org.n52.sensorweb</groupId>
			<artifactId>timeseries-series-dao</artifactId>
			<version>${timeseries.api.version}</version>
		</dependency>
		<dependency>
			<groupId>${project.groupId}</groupId>
			<artifactId>webapp</artifactId>
			<type>war</type>
		</dependency>
		<dependency>
			<groupId>org.n52.sensorweb</groupId>
    		<artifactId>restful-timeseries-client</artifactId>
    		<version>1.0.0</version>
			<type>war</type>
		</dependency>
	</dependencies>
	<profiles>
		<profile>
            <id>assembly</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <executions>
                        	<execution>
                        		<phase>install</phase>
                        		<goals>
                        			<goal>single</goal>
                        		</goals>
                        		<configuration>
                        			<finalName>52n-sensorweb-sos-bundle-${project.version}</finalName>
                        			<appendAssemblyId>false</appendAssemblyId>
                        		</configuration>
                        	</execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
            <dependencies>
                <dependency>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>hibernate-datasource-oracle</artifactId>
                </dependency>
                <dependency>
                    <groupId>${project.groupId}</groupId>
                    <artifactId>hibernate-datasource-sqlserver</artifactId>
                </dependency>
            </dependencies>
        </profile>
	</profiles>
</project>