<?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>
        <groupId>org.n52.series-api</groupId>
        <artifactId>series-sos-proxy</artifactId>
        <version>1.0.0-alpha.9</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>proxy-webapp</artifactId>
    <packaging>war</packaging>
    <name>Series REST API - SOS Proxy Webapp</name>
    <description>RESTful Sensor Web Client API as template Web application.</description>

    <properties>
        <postgis.version>2.2.0</postgis.version>
        <aspectj.version>1.8.9</aspectj.version>
        <postgresql.version>9.4.1208.jre7</postgresql.version>
        <webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
        <config.logger.fileappender.filepath>${catalina.base:-.}/logs/${project.build.finalName}</config.logger.fileappender.filepath>
    </properties>

    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>rest</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>proxy-dao</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>proxy-mappings</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>${project.groupId}.db</groupId>
            <artifactId>dao</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-oxm</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aop</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aspects</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
        </dependency>

        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjtools</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>c3p0</groupId>
            <artifactId>c3p0</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>net.postgis</groupId>
            <artifactId>postgis-jdbc</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>postgresql</groupId>
                    <artifactId>postgresql</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>ch.qos.logback</groupId>
                    <artifactId>logback-core</artifactId>
                </exclusion>
            </exclusions>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-ehcache</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>com.thetransactioncompany</groupId>
            <artifactId>cors-filter</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <scope>runtime</scope>
        </dependency>
        
        <dependency>
            <groupId>org.n52.arctic-sea</groupId>
            <artifactId>iceland</artifactId>
            <scope>runtime</scope>
        </dependency>
        
    </dependencies>

    <build>
        <finalName>${project.artifactId}</finalName>
        <outputDirectory>${webappDirectory}/WEB-INF/classes</outputDirectory>
        <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>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
            </plugin>
        </plugins>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <configuration>
                        <artifactItems>
                            <artifactItem>
                                <groupId>${project.groupId}</groupId>
                                <artifactId>rest</artifactId>
                                <includes>api-doc/**</includes>
                                <outputDirectory>${webappDirectory}</outputDirectory>
                                <overWrite>false</overWrite>
                            </artifactItem>
                            <!--                             <artifactItem> -->
                            <!--                                 <groupId>${project.groupId}</groupId> -->
                            <!--                                 <artifactId>series-mappings</artifactId> -->
                            <!--                                 <includes>hbm/**</includes> -->
                            <!--                                 <outputDirectory>${project.build.outputDirectory}</outputDirectory> -->
                            <!--                                 <overWrite>true</overWrite> -->
                            <!--                             </artifactItem> -->
                        </artifactItems>
                        <overWriteReleases>false</overWriteReleases>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>2.6</version>
                    <configuration>
                        <filteringDeploymentDescriptors>true</filteringDeploymentDescriptors>
                        <webappDirectory>${webappDirectory}</webappDirectory>
                        <webResources>
                            <resource>
                                <directory>src/main/webapp</directory>
                                <filtering>true</filtering>
                            </resource>
                        </webResources>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.eclipse.jetty</groupId>
                    <artifactId>jetty-maven-plugin</artifactId>
                    <configuration>
                        <stopKey>C</stopKey>
                        <stopPort>34343</stopPort>
                        <scanIntervalSeconds>0</scanIntervalSeconds>
                        <reload>manual</reload>
                        <webAppConfig>
                            <contextPath>/</contextPath>
                            <allowDuplicateFragmentNames>true</allowDuplicateFragmentNames>
                            <extraClasspath>/target/classes/;${project.build.outputDirectory};../sos-proxy/target/classes;../series-dao/target/classes;../../io/target/classes;../../rest/target/classes;</extraClasspath>
                        </webAppConfig>
                        <scanTargets>
                            <scanTarget>/target/classes/</scanTarget>
                            <scanTarget>../series-dao/target/classes</scanTarget>
                            <scanTarget>../sos-proxy/target/classes</scanTarget>
                            <scanTarget>../../../io/target/classes</scanTarget>
                            <scanTarget>../../../rest/target/classes</scanTarget>
                        </scanTargets>
                        <systemProperties>
                            <systemProperty>
                                <name>catalina.base</name>
                                <value>${project.build.directory}</value>
                            </systemProperty>
                        </systemProperties>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

</project>
