<?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/xsd/maven-4.0.0.xsd">

    <!--

        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.
    -->

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.apache.karaf</groupId>
        <artifactId>decanter</artifactId>
        <version>2.12.0</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <groupId>org.apache.karaf.decanter</groupId>
    <artifactId>itest</artifactId>
    <name>Apache Karaf :: Decanter :: Integration Tests</name>

    <dependencies>
        <dependency>
            <groupId>org.apache.karaf.itests</groupId>
            <artifactId>common</artifactId>
            <version>${karaf.version}</version>
        </dependency>

        <dependency>
            <groupId>javax.annotation</groupId>
            <artifactId>javax.annotation-api</artifactId>
            <version>1.3.2</version>
        </dependency>

        <dependency>
            <groupId>org.ops4j.pax.exam</groupId>
            <artifactId>pax-exam-container-karaf</artifactId>
            <scope>compile</scope>
            <optional>true</optional>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>org.apache.felix.configadmin</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.apache.karaf</groupId>
            <artifactId>apache-karaf</artifactId>
            <version>${karaf.version}</version>
            <type>tar.gz</type>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.ops4j.pax.logging</groupId>
            <artifactId>pax-logging-api</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.karaf.shell</groupId>
            <artifactId>org.apache.karaf.shell.core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.exam</groupId>
            <artifactId>pax-exam-junit4</artifactId>
            <scope>test</scope>
        </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>
            <version>1.3_1</version>
            <scope>runtime</scope>
        </dependency>

        <!-- dropwizard -->
        <dependency>
            <groupId>io.dropwizard.metrics</groupId>
            <artifactId>metrics-core</artifactId>
            <version>4.2.37</version>
        </dependency>

        <!-- camel -->
        <dependency>
            <groupId>org.apache.camel.karaf</groupId>
            <artifactId>camel-core-osgi</artifactId>
            <version>${camel.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.karaf.decanter.collector</groupId>
            <artifactId>org.apache.karaf.decanter.collector.camel</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>

        <!-- kafka -->
        <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>kafka-clients</artifactId>
            <version>${kafka.version}</version>
            <scope>test</scope>
        </dependency>

        <!-- mqtt -->
        <dependency>
            <groupId>org.eclipse.paho</groupId>
            <artifactId>org.eclipse.paho.client.mqttv3</artifactId>
            <version>1.2.5</version>
            <scope>test</scope>
        </dependency>

        <!-- servlet -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
            <scope>test</scope>
        </dependency>

        <!-- jms -->
        <dependency>
            <groupId>jakarta.jms</groupId>
            <artifactId>jakarta.jms-api</artifactId>
            <version>2.0.3</version>
        </dependency>

        <!-- websocket -->
        <dependency>
            <groupId>org.eclipse.jetty.websocket</groupId>
            <artifactId>websocket-client</artifactId>
            <version>9.4.58.v20250814</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.servicemix.tooling</groupId>
                <artifactId>depends-maven-plugin</artifactId>
                <version>1.5.0</version>
                <executions>
                    <execution>
                        <id>generate-depends-file</id>
                        <goals>
                            <goal>generate-depends-file</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin><!-- workaround for https://issues.apache.org/jira/browse/SM-5021 -->
                <groupId>com.google.code.maven-replacer-plugin</groupId>
                <artifactId>replacer</artifactId>
                <version>1.5.3</version>
                <executions>
                    <execution>
                        <id>fix-depends-RB</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>replace</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <file>${project.build.directory}/classes/META-INF/maven/dependencies.properties</file>
                    <replacements>
                        <replacement>
                            <token># Generated at: .+</token>
                            <value>#</value>
                        </replacement>
                    </replacements>
                    <regex>true</regex>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <forkCount>1</forkCount>
                    <reuseForks>false</reuseForks>
                    <systemPropertyVariables>
                        <org.ops4j.pax.logging.DefaultServiceLog.level>INFO</org.ops4j.pax.logging.DefaultServiceLog.level>
                        <activemq.version>${activemq.version}</activemq.version>
                        <camel.version>${camel.version}</camel.version>
                        <decanter.version>${project.version}</decanter.version>
                        <paho.version>${paho.version}</paho.version>
                    </systemPropertyVariables>
                    <excludes>
                        <!-- Require Kafka running instance -->
                        <exclude>**/KafkaCollectorTest.java</exclude>
                        <!-- Require Cassandra running instance -->
                        <exclude>**/CassandraAppenderTest.java</exclude>
                        <!-- Require Elasticsearch running instance -->
                        <exclude>**/ElasticsearchAppenderTest.java</exclude>
                        <!-- Require MongoDB running instance -->
                        <exclude>**/MongodbAppenderTest.java</exclude>
                    </excludes>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>ci</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <excludes>
                                <!-- TODO these itests are problematic on CI, see https://github.com/apache/karaf-decanter/issues/369 -->
                                <exclude>**/OshiCollectorTest.java</exclude>
                                <exclude>**/SystemCollectorTest.java</exclude>
                                <exclude>**/Log4jSocketCollectorTest.java</exclude>
                                <exclude>**/SocketCollectorTest.java</exclude>
                                <exclude>**/KafkaCollectorTest.java</exclude>
                                <exclude>**/JmsCollectorTest.java</exclude>
                            </excludes>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
