<?xml version="1.0" encoding="UTF-8"?>
<!--
    R Service Bus
    
    Copyright (c) Copyright of OpenAnalytics BVBA, 2010-2014
 
    ===========================================================================
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.
 
    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>
        
    @author rsb.development@openanalytics.eu
-->
<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>
    <groupId>eu.openanalytics</groupId>
    <artifactId>rsb</artifactId>
    <packaging>war</packaging>
    <version>6.0</version>
    <name>R Service Bus</name>
    <description>A communication middleware and work manager for R statistic analysis jobs.</description>
    <url>http://openanalytics.eu</url>
    <licenses>
        <license>
            <name>GNU AFFERO GENERAL PUBLIC LICENSE</name>
            <url>http://www.gnu.org/licenses/</url>
        </license>
    </licenses>
    <organization>
        <name>OpenAnalytics BVBA</name>
        <url>http://openanalytics.eu</url>
    </organization>

    <properties>
        <rj.version>2.0.1.b201406211200</rj.version>
        <rj.servi.version>2.0.0.b201406211200</rj.servi.version>
        <eruntime.version>1.4.0.b201406211200</eruntime.version>

        <spring.version>3.2.6.RELEASE</spring.version>
        <spring-security.version>3.2.0.RELEASE</spring-security.version>
        <spring-integration.version>3.0.0.RELEASE</spring-integration.version>
        <activemq.version>5.7.0</activemq.version>
        <cxf.version>2.7.8</cxf.version>
        <jetty-plugin.version>8.1.14.v20131031</jetty-plugin.version>
        <soapui.version>4.5.1</soapui.version>
        <tomcat.version>7.0.42</tomcat.version>
        <local.server.port>8888</local.server.port>
    </properties>

    <scm>
        <url>https://github.com/openanalytics/RSB</url>
    </scm>
    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/openanalytics/RSB/issues</url>
    </issueManagement>

    <repositories>
        <repository>
            <id>oa-public</id>
            <name>OpenAnalytics Public Repository</name>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <url>http://nexus.openanalytics.eu/nexus/content/groups/public</url>
        </repository>
        <repository>
            <id>eviware</id>
            <name>Eviware (soapUI) Repository</name>
            <url>http://www.eviware.com/repository/maven2</url>
            <layout>default</layout>
        </repository>
    </repositories>

    <distributionManagement>
        <snapshotRepository>
            <id>oa-nexus-snapshots</id>
            <name>OpenAnalytics Snapshots Repository</name>
            <url>http://nexus.internal.openanalytics.eu:8080/nexus/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>oa-nexus-releases</id>
            <name>OpenAnalytics Releases Repository</name>
            <url>http://nexus.internal.openanalytics.eu:8080/nexus/content/repositories/releases</url>
        </repository>
        <site>
            <id>oa-www</id>
            <url>file:///usr/share/nginx/www/maven-sites/rsb/${project.artifactId}-${project.version}</url>
        </site>
    </distributionManagement>

    <dependencies>
        <!-- RServi -->
        <dependency>
            <groupId>de.walware.rj</groupId>
            <artifactId>de.walware.rj.client</artifactId>
            <version>${rj.version}</version>
        </dependency>
        <dependency>
            <groupId>de.walware.rj</groupId>
            <artifactId>de.walware.rj.server</artifactId>
            <version>${rj.version}</version>
        </dependency>
        <dependency>
            <groupId>de.walware.rj</groupId>
            <artifactId>de.walware.rj.data</artifactId>
            <version>${rj.servi.version}</version>
        </dependency>
        <dependency>
            <groupId>de.walware.rj</groupId>
            <artifactId>de.walware.rj.servi</artifactId>
            <version>${rj.servi.version}</version>
        </dependency>
        <dependency>
            <groupId>de.walware.rj</groupId>
            <artifactId>de.walware.rj.services.eruntime</artifactId>
            <version>${eruntime.version}</version>
        </dependency>

        <!-- Spring -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context-support</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jms</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <!-- Spring Integration -->
        <dependency>
            <groupId>org.springframework.integration</groupId>
            <artifactId>spring-integration-http</artifactId>
            <version>${spring-integration.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.integration</groupId>
            <artifactId>spring-integration-file</artifactId>
            <version>${spring-integration.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.integration</groupId>
            <artifactId>spring-integration-mail</artifactId>
            <version>${spring-integration.version}</version>
        </dependency>

        <!-- Spring Security -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-config</artifactId>
            <version>${spring-security.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
            <version>${spring-security.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-taglibs</artifactId>
            <version>${spring-security.version}</version>
        </dependency>

        <!-- CXF -->
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-api</artifactId>
            <version>${cxf.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-core</artifactId>
            <version>${cxf.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.geronimo.specs</groupId>
                    <artifactId>geronimo-javamail_1.4_spec</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-jaxws</artifactId>
            <version>${cxf.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-jaxrs</artifactId>
            <version>${cxf.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-databinding-aegis</artifactId>
            <version>${cxf.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-transports-http</artifactId>
            <version>${cxf.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-rs-extension-providers</artifactId>
            <version>${cxf.version}</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.jettison</groupId>
            <artifactId>jettison</artifactId>
            <version>1.3.5</version>
        </dependency>

        <!-- JMS -->
        <dependency>
            <groupId>javax.jms</groupId>
            <artifactId>jms</artifactId>
            <version>1.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>activemq-core</artifactId>
            <version>${activemq.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-context</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.geronimo.specs</groupId>
                    <artifactId>geronimo-jms_1.1_spec</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.geronimo.specs</groupId>
                    <artifactId>geronimo-j2ee-management_1.1_spec</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.fusesource.fuse-extra</groupId>
                    <artifactId>fusemq-leveldb</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- JavaX -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
            <scope>provided</scope>
        </dependency>

        <!-- JMX -->
        <dependency>
            <groupId>mx4j</groupId>
            <artifactId>mx4j-tools</artifactId>
            <version>3.0.1</version>
        </dependency>

        <!-- Redis -->
        <dependency>
            <groupId>redis.clients</groupId>
            <artifactId>jedis</artifactId>
            <version>2.2.1</version>
        </dependency>

        <!-- Support -->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.2.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-math3</artifactId>
            <version>3.2</version>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.4</version>
        </dependency>
        <dependency>
            <groupId>commons-validator</groupId>
            <artifactId>commons-validator</artifactId>
            <version>1.4.0</version>
        </dependency>
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>1.9</version>
        </dependency>
        <dependency>
            <groupId>commons-pool</groupId>
            <artifactId>commons-pool</artifactId>
            <version>1.6</version>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-compress</artifactId>
            <version>1.5</version>
        </dependency>
        <dependency>
            <groupId>org.codehaus.jackson</groupId>
            <artifactId>jackson-xc</artifactId>
            <version>1.9.11</version>
        </dependency>
        <dependency>
            <groupId>org.antlr</groupId>
            <artifactId>stringtemplate</artifactId>
            <version>4.0.2</version>
        </dependency>
        <dependency>
            <groupId>ca.juliusdavies</groupId>
            <artifactId>not-yet-commons-ssl</artifactId>
            <version>0.3.11</version>
        </dependency>

        <!-- Logging -->
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.1.1</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.5</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-jcl</artifactId>
            <version>1.7.5</version>
        </dependency>

        <!-- Testing -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.11</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-library</artifactId>
            <version>1.3</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-core</artifactId>
            <version>1.3</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>1.9.5</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>xmlunit</groupId>
            <artifactId>xmlunit</artifactId>
            <version>1.5</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>${spring.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <finalName>rsb</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-codegen-plugin</artifactId>
                <version>${cxf.version}</version>
                <executions>
                    <execution>
                        <id>generate-sources</id>
                        <phase>generate-sources</phase>
                        <configuration>
                            <sourceRoot>${project.build.directory}/generated-sources/cxf</sourceRoot>
                            <wsdlOptions>
                                <wsdlOption>
                                    <wsdl>${basedir}/src/main/resources/wsdl/mtom-jobs.wsdl</wsdl>
                                    <wsdlLocation>classpath:wsdl/mtom-jobs.wsdl</wsdlLocation>
                                </wsdlOption>
                            </wsdlOptions>
                        </configuration>
                        <goals>
                            <goal>wsdl2java</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jvnet.jaxb2.maven2</groupId>
                <artifactId>maven-jaxb2-plugin</artifactId>
                <version>0.7.4</version>
                <executions>
                    <execution>
                        <id>generate-sources</id>
                        <phase>generate-sources</phase>
                        <configuration>
                            <schemaDirectory>src/main/resources/schemas</schemaDirectory>
                            <!-- exclude SOAP schemas who are indirectly picked up by wsdl2java -->
                            <schemaExcludes>
                                <exclude>soap-*.xsd</exclude>
                            </schemaExcludes>
                            <extension>true</extension>
                        </configuration>
                        <goals>
                            <goal>generate</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-eclipse-plugin</artifactId>
                <version>2.9</version>
                <configuration>
                    <downloadSources>true</downloadSources>
                    <additionalProjectnatures>
                        <projectNature>org.springframework.ide.eclipse.core.springnature</projectNature>
                    </additionalProjectnatures>
                    <additionalBuildcommands>
                        <buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
                    </additionalBuildcommands>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.16</version>
            </plugin>
            <plugin>
                <groupId>org.mortbay.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>${jetty-plugin.version}</version>
                <configuration>
                    <useTestClasspath>true</useTestClasspath>
                    <webAppConfig>
                        <contextPath>/rsb</contextPath>
                    </webAppConfig>
                    <connectors>
                        <connector
                            implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
                            <port>${local.server.port}</port>
                            <maxIdleTime>0</maxIdleTime>
                        </connector>
                    </connectors>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.6</version>
                <executions>
                    <execution>
                        <id>copy-resources</id>
                        <phase>pre-site</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${basedir}/target/site/misc</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>src/main/resources</directory>
                                    <includes>
                                        <include>**/*.xsd</include>
                                        <include>**/*.wsdl</include>
                                    </includes>
                                </resource>
                                <resource>
                                    <directory>src/test/resources</directory>
                                    <includes>
                                        <include>rsb-configuration*.json</include>
                                    </includes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                    <reportPlugins>
                        <plugin>
                            <groupId>org.codehaus.enunciate</groupId>
                            <artifactId>maven-enunciate-plugin</artifactId>
                            <version>1.28</version>
                            <configuration>
                                <configFile>enunciate.xml</configFile>
                                <docsSubdir>wsdocs</docsSubdir>
                            </configuration>
                        </plugin>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-project-info-reports-plugin</artifactId>
                            <version>2.7</version>
                            <reportSets>
                                <reportSet>
                                    <reports>
                                        <report>summary</report>
                                        <report>license</report>
                                        <report>scm</report>
                                        <report>issue-tracking</report>
                                        <report>dependencies</report>
                                        <report>plugins</report>
                                        <report>plugin-management</report>
                                    </reports>
                                </reportSet>
                            </reportSets>
                        </plugin>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-javadoc-plugin</artifactId>
                            <version>2.9.1</version>
                        </plugin>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-surefire-report-plugin</artifactId>
                            <version>2.16</version>
                        </plugin>
                        <plugin>
                            <groupId>org.codehaus.mojo</groupId>
                            <artifactId>findbugs-maven-plugin</artifactId>
                            <version>2.5.3</version>
                        </plugin>
                        <plugin>
                            <groupId>org.codehaus.mojo</groupId>
                            <artifactId>cobertura-maven-plugin</artifactId>
                            <version>2.6</version>
                        </plugin>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-jxr-plugin</artifactId>
                            <version>2.4</version>
                        </plugin>
                    </reportPlugins>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <version>2.5</version>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>${basedir}</directory>
                            <includes>
                                <include>soapui.log</include>
                                <include>soapui-errors.log</include>
                                <include>global-groovy.log</include>
                                <include>MTOM_SOAP_API*.*</include>
                            </includes>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <archive>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.mycila.maven-license-plugin</groupId>
                <artifactId>maven-license-plugin</artifactId>
                <version>1.9.0</version>
                <configuration>
                    <header>LICENSE_HEADER</header>
                    <aggregate>true</aggregate>
                    <excludes>
                        <exclude>**/package-info.java</exclude>

                        <exclude>src/main/webapp/css/jstree-classic/*.css</exclude>
                        <exclude>src/main/webapp/css/blackbird.css</exclude>
                        <exclude>src/main/webapp/css/jquery*.css</exclude>
                        <exclude>src/main/webapp/css/openid.css</exclude>
                        <exclude>src/main/webapp/css/ui.panel.css</exclude>

                        <exclude>src/main/webapp/js/blackbird.js</exclude>
                        <exclude>src/main/webapp/js/date.js</exclude>
                        <exclude>src/main/webapp/js/jquery*.js</exclude>
                        <exclude>src/main/webapp/js/jstree*.js</exclude>
                        <exclude>src/main/webapp/js/openid*.js</exclude>
                        <exclude>src/main/webapp/js/ui.panel.min.js</exclude>

                        <exclude>src/misc/tomcat-users.xml</exclude>
                        <exclude>src/main/webapp/WEB-INF/web.xml</exclude>

                        <exclude>src/test/resources/data/*.txt</exclude>

                        <exclude>src/it/config/rsb-it-soapui-*.xml</exclude>
                    </excludes>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>javax-dependencies</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>javax.servlet</groupId>
                    <artifactId>jstl</artifactId>
                    <version>1.2</version>
                </dependency>
                <dependency>
                    <groupId>javax.mail</groupId>
                    <artifactId>mail</artifactId>
                    <version>1.4.5</version>
                </dependency>
                <dependency>
                    <groupId>javax.jms</groupId>
                    <artifactId>jms</artifactId>
                    <version>1.1</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.geronimo.specs</groupId>
                    <artifactId>geronimo-j2ee-management_1.1_spec</artifactId>
                    <version>1.0.1</version>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>tomcat</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.cargo</groupId>
                        <artifactId>cargo-maven2-plugin</artifactId>
                        <version>1.4.4</version>
                        <configuration>
                            <wait>true</wait>
                            <container>
                                <containerId>tomcat7x</containerId>
                                <zipUrlInstaller>
                                    <url>http://archive.apache.org/dist/tomcat/tomcat-7/v${tomcat.version}/bin/apache-tomcat-${tomcat.version}.zip</url>
                                    <!-- 
                                    <installDir>${cargo.install.tomcat.dir}</installDir>
                                     -->
                                </zipUrlInstaller>
                                <output>${cargo.container.log}</output>
                                <append>false</append>
                                <log>${cargo.log}</log>
                            </container>
                            <configuration>
                                <home>${cargo.home.tomcat.dir}</home>
                                <!-- 
                                <deployables>
                                    <deployable>
                                        <pingURL>http://localhost:${local.server.port}/${project.build.finalName}/index.html</pingURL>
                                    </deployable>
                                </deployables>
                                 -->
                                <properties>
                                    <cargo.servlet.port>${local.server.port}</cargo.servlet.port>
                                </properties>
                            </configuration>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
            <properties>
                <cargo.install.dir>${java.io.tmpdir}/cargo</cargo.install.dir>
                <!-- 
                <cargo.install.tomcat.dir>${cargo.install.dir}/tomcat</cargo.install.tomcat.dir>
                -->
                <cargo.home.dir>${project.build.directory}/cargo</cargo.home.dir>
                <cargo.home.tomcat.dir>${cargo.home.dir}/tomcat</cargo.home.tomcat.dir>
                <cargo.log>${cargo.home.dir}/cargo.log</cargo.log>
                <cargo.container.log>${cargo.home.dir}/container.log</cargo.container.log>
            </properties>
        </profile>
        <profile>
            <id>it</id>
            <build>
                <testResources>
                    <testResource>
                        <directory>src/test/resources</directory>
                    </testResource>
                    <testResource>
                        <directory>src/it/resources</directory>
                    </testResource>
                </testResources>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>build-helper-maven-plugin</artifactId>
                        <version>1.5</version>
                        <executions>
                            <execution>
                                <id>add-test-source</id>
                                <phase>generate-test-sources</phase>
                                <goals>
                                    <goal>add-test-source</goal>
                                </goals>
                                <configuration>
                                    <sources>
                                        <source>src/it/java</source>
                                    </sources>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <version>2.8</version>
                        <configuration>
                            <additionalClasspathElements>
                                <additionalClasspathElement>${basedir}/conf</additionalClasspathElement>
                            </additionalClasspathElements>
                        </configuration>
                        <executions>
                            <execution>
                                <id>integration-test</id>
                                <goals>
                                    <goal>integration-test</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>verify</id>
                                <goals>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.mortbay.jetty</groupId>
                        <artifactId>jetty-maven-plugin</artifactId>
                        <version>${jetty-plugin.version}</version>
                        <configuration>
                            <useTestClasspath>true</useTestClasspath>
                            <stopPort>8805</stopPort>
                            <stopKey>STOP</stopKey>
                            <webAppConfig>
                                <contextPath>/rsb</contextPath>
                                <overrideDescriptor>src/it/resources/override-web.xml</overrideDescriptor>
                            </webAppConfig>
                            <connectors>
                                <connector
                                    implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
                                    <port>${local.server.port}</port>
                                    <maxIdleTime>0</maxIdleTime>
                                </connector>
                            </connectors>
                            <systemProperties>
                                <systemProperty>
                                    <name>org.eclipse.jetty.util.log.INFO</name>
                                    <value>true</value>
                                </systemProperty>
                                <systemProperty>
                                    <name>eu.openanalytics.rsb.config.ConfigurationFactory.skipValidation</name>
                                    <value>true</value>
                                </systemProperty>
                            </systemProperties>
                        </configuration>
                        <executions>
                            <execution>
                                <id>start-jetty</id>
                                <phase>pre-integration-test</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <daemon>true</daemon>
                                </configuration>
                            </execution>
                            <execution>
                                <id>stop-jetty</id>
                                <phase>post-integration-test</phase>
                                <goals>
                                    <goal>stop</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
            <dependencies>
                <dependency>
                    <groupId>org.apache.httpcomponents</groupId>
                    <artifactId>httpclient</artifactId>
                    <version>4.2.1</version>
                </dependency>
                <dependency>
                    <groupId>com.icegreen</groupId>
                    <artifactId>greenmail</artifactId>
                    <version>1.3.1b</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>httpunit</groupId>
                    <artifactId>httpunit</artifactId>
                    <version>1.7</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>net.sourceforge.htmlunit</groupId>
                    <artifactId>htmlunit</artifactId>
                    <version>2.8</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>rhino</groupId>
                    <artifactId>js</artifactId>
                    <version>1.7R2</version>
                    <scope>test</scope>
                </dependency>
                <dependency>
                    <groupId>eviware</groupId>
                    <artifactId>maven-soapui-plugin</artifactId>
                    <version>${soapui.version}</version>
                    <scope>test</scope>
                    <exclusions>
                        <exclusion>
                            <groupId>activesoap</groupId>
                            <artifactId>jaxb-impl</artifactId>
                        </exclusion>
                    </exclusions>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>tomcat-distribution</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-dependency-plugin</artifactId>
                        <version>2.2</version>
                        <executions>
                            <execution>
                                <id>tomcat-dependencies</id>
                                <phase>process-sources</phase>
                                <goals>
                                    <goal>unpack</goal>
                                </goals>
                                <configuration>
                                    <artifactItems>
                                        <artifactItem>
                                            <groupId>org.apache</groupId>
                                            <artifactId>tomcat-core</artifactId>
                                            <version>${tomcat.version}</version>
                                            <type>zip</type>
                                            <overWrite>false</overWrite>
                                            <outputDirectory>${project.build.directory}/</outputDirectory>
                                        </artifactItem>
                                        <artifactItem>
                                            <groupId>de.walware.rj</groupId>
                                            <artifactId>de.walware.rj.servi.webapp</artifactId>
                                            <version>${rj.servi.version}</version>
                                            <type>war</type>
                                            <overWrite>false</overWrite>
                                            <outputDirectory>${project.build.directory}/rservi</outputDirectory>
                                        </artifactItem>
                                    </artifactItems>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-assembly-plugin</artifactId>
                        <version>2.4</version>
                        <executions>
                            <execution>
                                <phase>package</phase>
                                <goals>
                                    <goal>single</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <finalName>${project.build.finalName}-${project.version}</finalName>
                            <descriptors>
                                <descriptor>tomcat-distribution-assembly.xml</descriptor>
                            </descriptors>
                            <archiverConfig>
                                <fileMode>420</fileMode> <!-- 420(dec) = 644(oct) -->
                                <directoryMode>493</directoryMode> <!-- 493(dec) = 755(oct) -->
                                <defaultDirectoryMode>493</defaultDirectoryMode>
                            </archiverConfig>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>openid</id>
            <dependencies>
                <dependency>
                    <groupId>org.springframework.security</groupId>
                    <artifactId>spring-security-openid</artifactId>
                    <version>${spring-security.version}</version>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>ldap</id>
            <dependencies>
                <dependency>
                    <groupId>org.springframework.security</groupId>
                    <artifactId>spring-security-ldap</artifactId>
                    <version>${spring-security.version}</version>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>rdbms</id>
            <dependencies>
                <dependency>
                    <groupId>commons-dbcp</groupId>
                    <artifactId>commons-dbcp</artifactId>
                    <version>1.4</version>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>postgresql</id>
            <dependencies>
                <dependency>
                    <groupId>org.postgresql</groupId>
                    <artifactId>postgresql</artifactId>
                    <version>9.3-1100-jdbc41</version>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>mysql</id>
            <dependencies>
                <dependency>
                    <groupId>mysql</groupId>
                    <artifactId>mysql-connector-java</artifactId>
                    <version>5.1.28</version>
                </dependency>
            </dependencies>
        </profile>
    </profiles>
</project>
