<?xml version="1.0" encoding="UTF-8"?>
<!--
 Copyright © 2023 PANTHEON.tech, s.r.o. and others.  All rights reserved.

 This program and the accompanying materials are made available under the
 terms of the Eclipse Public License v1.0 which accompanies this distribution,
 and is available at http://www.eclipse.org/legal/epl-v10.html
 -->
<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">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.opendaylight.odlparent</groupId>
        <artifactId>odlparent</artifactId>
        <version>13.1.5</version>
        <relativePath>../odlparent</relativePath>
    </parent>

    <artifactId>features-test-plugin</artifactId>
    <packaging>maven-plugin</packaging>
    <name>ODL :: odlparent :: ${project.artifactId}</name>

    <prerequisites>
        <maven>3.8.3</maven>
    </prerequisites>

    <properties>
        <!-- Do not delete: pax.exam.version property is used in copy resources -->
        <!-- NB 4.13.3 is last known ok version allowing concurrent karaf containers -->
        <!-- pax exam issue https://github.com/ops4j/org.ops4j.pax.exam2/issues/1020 -->
        <pax.exam.version>4.13.3</pax.exam.version>
        <pax.url.version>2.6.2</pax.url.version>
    </properties>

    <dependencies>
        <!-- Maven plugin API -->
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-artifact</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-model</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
        </dependency>
        <!-- dependencies to annotations -->
        <dependency>
            <groupId>org.apache.maven.plugin-tools</groupId>
            <artifactId>maven-plugin-annotations</artifactId>
        </dependency>

        <!-- dependency resolution -->
        <dependency>
            <groupId>org.apache.maven.wagon</groupId>
            <artifactId>wagon-http</artifactId>
        </dependency>
        <dependency>
            <groupId>org.eclipse.aether</groupId>
            <artifactId>aether-api</artifactId>
        </dependency>

        <!-- Pax artifacts, includes scope redefined (test to compile/runtime) dependencies
            in order to be included (preloaded to local repo) on plugin execution -->
        <dependency>
            <groupId>org.ops4j.pax.exam</groupId>
            <artifactId>pax-exam</artifactId>
            <version>${pax.exam.version}</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.exam</groupId>
            <artifactId>pax-exam-link-mvn</artifactId>
            <version>${pax.exam.version}</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.url</groupId>
            <artifactId>pax-url-aether</artifactId>
            <version>${pax.url.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.url</groupId>
            <artifactId>pax-url-link</artifactId>
            <version>${pax.url.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.exam</groupId>
            <artifactId>pax-exam-container-karaf</artifactId>
            <version>${pax.exam.version}</version>
            <scope>compile</scope>
        </dependency>

        <!-- required features -->
        <dependency>
            <groupId>org.ops4j.pax.exam</groupId>
            <artifactId>pax-exam-features</artifactId>
            <version>${pax.exam.version}</version>
            <type>xml</type>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.karaf.features</groupId>
            <artifactId>standard</artifactId>
            <version>${karaf.version}</version>
            <classifier>features</classifier>
            <type>xml</type>
            <scope>runtime</scope>
        </dependency>

        <!-- OSGi -->
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.framework</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.service.resolver</artifactId>
            <scope>compile</scope>
        </dependency>

        <!-- test probe dependencies for karaf environment -->
        <dependency>
            <groupId>org.apache.karaf.features</groupId>
            <artifactId>org.apache.karaf.features.core</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.karaf.bundle</groupId>
            <artifactId>org.apache.karaf.bundle.core</artifactId>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.eclipse.jdt</groupId>
            <artifactId>org.eclipse.jdt.annotation</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.opendaylight.odlparent</groupId>
            <artifactId>bundles-diag</artifactId>
            <scope>compile</scope>
        </dependency>

        <!-- junit 4 @Test annotation is required for junit probe invoker -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>compile</scope>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <executions>
                    <execution>
                        <id>check-license</id>
                        <configuration>
                            <excludes>
                                <!-- Skip Apache Licensed files -->
                                org/opendaylight/odlparent/features/test/plugin/TestFeaturesMojo.java
                            </excludes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-plugin-plugin</artifactId>
                <configuration>
                    <goalPrefix>feattest</goalPrefix>
                </configuration>
                <executions>
                    <execution>
                        <id>default-descriptor</id>
                        <phase>process-classes</phase>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
