<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright 2016 Red Hat Inc. and/or its affiliates and other contributors.
-
- 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.
-->
<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.switchyard.karaf</groupId>
        <artifactId>switchyard-karaf-parent</artifactId>
        <version>2.1.0-redhat-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>switchyard-karaf-tests</artifactId>
    <packaging>jar</packaging>
    <name>SwitchYard: Karaf Tests</name>
    <description>SwitchYard Karaf Tests</description>
    <properties>
        <!-- a horrible hack put in because the karaf we are using (2.4.0.redhat-620106 -->
        <!-- doesn't match the directory it unpacks (apache-karaf-2.4.0) -->
        <version.karaf.tgz>${version.org.apache.karaf}</version.karaf.tgz>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.switchyard.karaf</groupId>
            <artifactId>switchyard-karaf-deploy</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.exam</groupId>
            <artifactId>pax-exam</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.exam</groupId>
            <artifactId>pax-exam-junit4</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.exam</groupId>
            <artifactId>pax-exam-container-karaf</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.karaf</groupId>
            <artifactId>apache-karaf</artifactId>
            <type>tar.gz</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.jboss.spec.javax.jms</groupId>
            <artifactId>jboss-jms-api_1.1_spec</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>activemq-client</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.components</groupId>
            <artifactId>switchyard-component-test-mixin-http</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard</groupId>
            <artifactId>switchyard-remote</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.karaf</groupId>
            <artifactId>switchyard</artifactId>
            <type>xml</type>
            <classifier>features</classifier>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-camel-cxf-binding</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-remote-invoker</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-transform-datamapper</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.switchyard.quickstarts</groupId>
            <artifactId>switchyard-transform-dozer</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.fusesource.mqtt-client</groupId>
            <artifactId>mqtt-client</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>activemq-broker</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>activemq-mqtt</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>activemq-karaf</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.ftpserver</groupId>
            <artifactId>ftpserver-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.ftpserver</groupId>
            <artifactId>ftplet-api</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.sshd</groupId>
            <artifactId>sshd-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.sshd</groupId>
            <artifactId>sshd-sftp</artifactId>
        </dependency>
        <dependency>
            <groupId>com.jcraft</groupId>
            <artifactId>jsch</artifactId>
        </dependency>
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcpg-jdk15on</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcpkix-jdk15on</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.servicemix.tooling</groupId>
                <artifactId>depends-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>generate-depends-file</id>
                        <goals>
                            <goal>generate-depends-file</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${version.maven.plugin.surefire.itests}</version>
                <configuration>
                    <systemPropertyVariables>
                        <java.awt.headless>true</java.awt.headless>
                    </systemPropertyVariables>
                    <includes>
                        <include>**/*Test*.java</include>
                    </includes>
                    <excludes>
			<!-- Excluded after Camel 2.17-->
                        <exclude>**/RemoteInvokerQuickstartTest.java</exclude>
                        <exclude>**/TransformDozerQuickstartTest.java</exclude> 

                        <exclude>**/CamelDozerQuickstartTest.java</exclude>
                        <exclude>**/TransformDatamapperQuickstartTest.java</exclude>

                        <exclude>**/Bpel*.java</exclude>
                        <exclude>**/Abstract*.java</exclude>
                        <exclude>**/*$*</exclude>
                        <exclude>**/ClusterDemoQuickstartTest.java</exclude>
                        <exclude>**/CamelNettyBindingQuickstartTest.java</exclude>
                        <!-- Fails in test kit, but not standalone -->
                        <exclude>**/CamelSAPBindingQuickstartTest.java</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.karaf.tooling</groupId>
                <artifactId>features-maven-plugin</artifactId>
                <version>2.4.0</version>
                <executions>
                    <execution>
                        <id>add-features-to-repo</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>add-features-to-repo</goal>
                        </goals>
                        <configuration>
                            <karafVersion>${version.org.apache.karaf}</karafVersion>
                            <descriptors>
                                <descriptor>mvn:org.apache.karaf.assemblies.features/spring/${version.org.apache.karaf}/xml/features</descriptor>
                                <descriptor>mvn:org.switchyard.karaf/switchyard/${project.version}/xml/features</descriptor>
                                <descriptor>mvn:org.fusesource/camel-sap/${version.camelsap}/xml/features</descriptor>
                            </descriptors>
                            <features>
                                <feature version="${project.version}">switchyard</feature>
                                <feature version="${project.version}">switchyard-amqp</feature>
                                <feature version="${project.version}">switchyard-atom</feature>
                                <feature version="${project.version}">switchyard-bpel</feature>
                                <feature version="${project.version}">switchyard-bean</feature>
                                <feature version="${project.version}">switchyard-cdi</feature>
                                <feature version="${project.version}">switchyard-camel</feature>
                                <feature version="${project.version}">switchyard-file</feature>
                                <feature version="${project.version}">switchyard-ftp</feature>
                                <feature version="${project.version}">switchyard-jms</feature>
                                <feature version="${project.version}">switchyard-jpa</feature>
                                <feature version="${project.version}">switchyard-mail</feature>
                                <feature version="${project.version}">switchyard-mqtt</feature>
                                <feature version="${project.version}">switchyard-netty</feature>
                                <feature version="${project.version}">switchyard-quartz</feature>
                                <feature version="${project.version}">switchyard-rss</feature>
                                <feature version="${project.version}">switchyard-sql</feature>
                                <feature version="${project.version}">switchyard-soap</feature>
                                <feature version="${project.version}">switchyard-sap</feature>
                                <feature version="${version.org.apache.camel}">camel-bindy</feature>
                                <feature version="${version.org.apache.camel}">camel-hl7</feature>
                                <feature version="${version.org.apache.camel}">camel-mina2</feature>
                                <feature version="${version.org.apache.camel}">camel-jaxb</feature>
                                <feature version="${version.org.apache.camel}">camel-saxon</feature>
                                <feature version="${version.org.apache.camel}">camel-jackson</feature>
                                <feature version="${version.org.apache.camel}">camel-dozer</feature>
                                <feature version="${version.org.apache.activemq}">activemq-broker</feature>
				<feature version="1.1">jms-spec</feature>
                            </features>
                            <repository>target/dependencies/apache-karaf-${version.karaf.tgz}/system</repository>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>unpack</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>unpack</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>org.apache.karaf</groupId>
                                    <artifactId>apache-karaf</artifactId>
                                    <type>tar.gz</type>
                                    <outputDirectory>target/dependencies</outputDirectory>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <id>bin</id>
                        <phase>generate-test-resources</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <descriptors>
                                <descriptor>src/main/assembly/bin.xml</descriptor>
                            </descriptors>
                            <finalName>${project.artifactId}</finalName>
                            <tarLongFileMode>gnu</tarLongFileMode>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <repositories>
        <!-- Required to resolve feature bundles. -->
        <repository>
            <id>springsource.release</id>
            <name>Spring Release Repository</name>
            <url>https://repository.jboss.org/nexus/content/repositories/springsource-obr-releases/</url>
            <layout>default</layout>
            <releases>
                <enabled>true</enabled>
                <updatePolicy>never</updatePolicy>
            </releases>
            <snapshots>
                <enabled>false</enabled>
                <updatePolicy>never</updatePolicy>
            </snapshots>
        </repository>
        <repository>
            <id>springsource.external</id>
            <name>Spring External Repository</name>
            <url>https://repository.jboss.org/nexus/content/repositories/springsource-obr-external/</url>
            <layout>default</layout>
            <releases>
                <enabled>true</enabled>
                <updatePolicy>never</updatePolicy>
            </releases>
            <snapshots>
                <enabled>false</enabled>
                <updatePolicy>never</updatePolicy>
            </snapshots>
        </repository>
    </repositories>
</project>
