<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--

    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You 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 https://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.apache.camel.karaf</groupId>
        <artifactId>camel-karaf-tests</artifactId>
        <version>4.10.7</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>camel-karaf-features-test</artifactId>
    <packaging>pom</packaging>
    <name>Apache Camel :: Karaf :: Tests :: Features</name>

    <properties>
        <camel.karaf.test.additional.imports />
        <camel.karaf.test.fragment.host />
        <dump.logs.on.failure>false</dump.logs.on.failure>
        <keep.docker.images.on.exit>false</keep.docker.images.on.exit>
        <users.file.location>${project.basedir}/../../camel-integration-test/src/main/resources/etc/users.properties</users.file.location>
    </properties>

    <modules>
        <module>camel-activemq</module>
        <module>camel-amqp</module>
        <module>camel-arangodb</module>
        <module>camel-as2</module>
        <module>camel-asn1</module>
        <module>camel-atom</module>
        <module>camel-avro</module>
        <module>camel-aws2-iam</module>
        <module>camel-aws2-kinesis</module>
        <module>camel-aws2-s3</module>
        <module>camel-aws2-ses</module>
        <module>camel-aws2-sns</module>
        <module>camel-aws2-sqs</module>
        <module>camel-aws2-sts</module>
        <module>camel-azure-eventhubs</module>
        <module>camel-azure-storage-blob</module>
        <module>camel-azure-storage-queue</module>
        <module>camel-barcode</module>
        <module>camel-base64</module>
        <module>camel-bean-validator</module>
        <module>camel-bindy</module>
        <module>camel-caffeine</module>
        <module>camel-cbor</module>
        <module>camel-chatscript</module>
        <module>camel-coap</module>
        <module>camel-cometd</module>
        <module>camel-consul</module>
        <module>camel-core</module>
        <module>camel-couchdb</module>
        <module>camel-crypto</module>
        <module>camel-csv</module>
        <module>camel-cxf</module>
        <module>camel-cxf-jetty</module>
        <module>camel-debezium-mongodb</module>
        <module>camel-debezium-mysql</module>
        <module>camel-debezium-postgres</module>
        <module>camel-disruptor</module>
        <module>camel-dns</module>
        <module>camel-docker</module>
        <module>camel-drill</module>
        <module>camel-ehcache</module>
        <module>camel-elasticsearch</module>
        <module>camel-exec</module>
        <module>camel-fastjson</module>
        <module>camel-flatpack</module>
        <module>camel-ftp</module>
        <module>camel-google-pubsub</module>
        <module>camel-groovy</module>
        <module>camel-gson</module>
        <module>camel-hazelcast</module>
        <module>camel-http</module>
        <module>camel-influxdb2</module>
        <module>camel-jackson</module>
        <module>camel-jackson-avro</module>
        <module>camel-jackson-protobuf</module>
        <module>camel-jacksonxml</module>
        <module>camel-jaxb</module>
        <module>camel-jcache</module>
        <module>camel-jetty</module>
        <module>camel-jms</module>
        <module>camel-kafka</module>
        <module>camel-leveldb</module>
        <module>camel-netty-http</module>
        <module>camel-mail</module>
        <module>camel-olingo2</module>
        <module>camel-paho-mqtt5</module>
        <module>camel-quartz</module>
        <module>camel-saxon</module>
        <module>camel-spring-rabbitmq</module>
        <module>camel-velocity</module>
        <module>camel-weather</module>
        <module>camel-xslt-saxon</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.apache.karaf</groupId>
                <artifactId>karaf-bom</artifactId>
                <version>${karaf-version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.karaf.itests</groupId>
                <artifactId>common</artifactId>
                <version>${karaf-version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.apache.camel.karaf</groupId>
            <artifactId>camel-integration-test</artifactId>
            <version>${project.version}</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.camel.karaf</groupId>
            <artifactId>camel-core-osgi</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-core-engine</artifactId>
            <version>${camel-version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.camel</groupId>
            <artifactId>camel-mock</artifactId>
            <version>${camel-version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.camel.karaf</groupId>
            <artifactId>camel-api</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>osgi.core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.service.component</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.service.component.annotations</artifactId>
            <scope>provided</scope>
        </dependency>
        <!-- Provide the KarafTestSupport -->
        <dependency>
            <groupId>org.apache.karaf.itests</groupId>
            <artifactId>common</artifactId>
            <scope>test</scope>
        </dependency>
        <!-- Define the Apache Karaf version to download and use for the test -->
        <dependency>
            <groupId>org.apache.karaf</groupId>
            <artifactId>apache-karaf</artifactId>
            <scope>test</scope>
            <type>tar.gz</type>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.karaf</groupId>
                    <artifactId>org.apache.karaf.client</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.ops4j.pax.logging</groupId>
                    <artifactId>pax-logging-logback</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <!-- Required to use shell commands in the tests -->
        <dependency>
            <groupId>org.apache.karaf.shell</groupId>
            <artifactId>org.apache.karaf.shell.core</artifactId>
            <scope>test</scope>
        </dependency>
        <!-- Provide the PaxExam Karaf support -->
        <dependency>
            <groupId>org.ops4j.pax.exam</groupId>
            <artifactId>pax-exam-container-karaf</artifactId>
            <scope>test</scope>
        </dependency>
        <!-- Provide the PaxExam JUnit extension -->
        <dependency>
            <groupId>org.ops4j.pax.exam</groupId>
            <artifactId>pax-exam-junit4</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.geronimo.specs</groupId>
            <artifactId>geronimo-atinject_1.0_spec</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.awaitility</groupId>
            <artifactId>awaitility</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.servicemix.bundles</groupId>
            <artifactId>org.apache.servicemix.bundles.hamcrest</artifactId>
            <scope>runtime</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!-- generates an osgi repository added to the test karaf containing the dependencies-->
            <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.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <inherited>true</inherited>
                <extensions>true</extensions>
                <configuration>
                    <instructions>
                        <Export-Package>
                            org.apache.karaf.camel.test*;version=${project.version}
                        </Export-Package>
                        <Import-Package>
                            !org.apache.karaf.camel.test,
                            ${camel.karaf.test.additional.imports}
                            org.apache.camel*;${camel-osgi-import-camel-version},
                            *
                        </Import-Package>
                        <Fragment-Host>${camel.karaf.test.fragment.host}</Fragment-Host>
                    </instructions>
                </configuration>
                <executions>
                    <execution>
                        <id>cleanVersions</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>cleanVersions</goal>
                        </goals>
                        <configuration>
                            <versions>
                                <karaf.osgi.version>${project.version}</karaf.osgi.version>
                            </versions>
                        </configuration>
                    </execution>
                    <execution>
                        <id>bundle</id>
                        <phase>package</phase>
                        <goals>
                            <goal>bundle</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <executions>
                    <execution>
                        <id>default-test</id>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <phase>integration-test</phase>
                        <configuration>
                            <excludes>
                                <exclude>none</exclude>
                            </excludes>
                            <includes>
                                <include>**/*Test.java</include>
                            </includes>
                            <systemPropertyVariables>
                                <camel.karaf.itest.dump.logs>${dump.logs.on.failure}</camel.karaf.itest.dump.logs>
                                <camel.karaf.itest.keep.docker.images>${keep.docker.images.on.exit}</camel.karaf.itest.keep.docker.images>
                                <camel.karaf.version>${project.version}</camel.karaf.version>
                                <project.version>${project.version}</project.version>
                                <project.target>${project.build.directory}</project.target>
                                <users.file.location>${users.file.location}</users.file.location>
                                <org.ops4j.pax.logging.DefaultServiceLog.level>WARN</org.ops4j.pax.logging.DefaultServiceLog.level>
                            </systemPropertyVariables>
                            <forkedProcessExitTimeoutInSeconds>10</forkedProcessExitTimeoutInSeconds>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>