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

    Copyright 2021 OPS4J.

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

    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.ops4j.pax</groupId>
        <artifactId>jdbc</artifactId>
        <version>1.5.4</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <groupId>org.ops4j.pax.jdbc</groupId>
    <artifactId>pax-jdbc-features</artifactId>
    <packaging>pom</packaging>

    <name>OPS4J Pax JDBC Karaf Features</name>

    <description>
        Pax Jdbc module creating a features xml file to deploy Pax Jdbc components as features in Apache Karaf.
        To use this feature enter the following in your Karaf shell -
        feature:repo-add mvn:org.ops4j.pax.jdbc/pax-jdbc-features/${project.version}/xml/features
    </description>

    <dependencies>

        <!-- pax-jdbc own artifacts -->

        <dependency>
            <groupId>org.ops4j.pax.jdbc</groupId>
            <artifactId>pax-jdbc</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.jdbc</groupId>
            <artifactId>pax-jdbc-common</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.jdbc</groupId>
            <artifactId>pax-jdbc-pool-common</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.jdbc</groupId>
            <artifactId>pax-jdbc-config</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.jdbc</groupId>
            <artifactId>pax-jdbc-db2</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.jdbc</groupId>
            <artifactId>pax-jdbc-derbyclient</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.jdbc</groupId>
            <artifactId>pax-jdbc-derby</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.jdbc</groupId>
            <artifactId>pax-jdbc-hsqldb</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.jdbc</groupId>
            <artifactId>pax-jdbc-jtds</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.jdbc</groupId>
            <artifactId>pax-jdbc-mariadb</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.jdbc</groupId>
            <artifactId>pax-jdbc-mysql</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.jdbc</groupId>
            <artifactId>pax-jdbc-oracle</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.jdbc</groupId>
            <artifactId>pax-jdbc-pool-aries</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.jdbc</groupId>
            <artifactId>pax-jdbc-pool-c3p0</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.jdbc</groupId>
            <artifactId>pax-jdbc-pool-dbcp2</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.jdbc</groupId>
            <artifactId>pax-jdbc-pool-hikaricp</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.jdbc</groupId>
            <artifactId>pax-jdbc-sqlite</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.jdbc</groupId>
            <artifactId>pax-jdbc-teradata</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.jdbc</groupId>
            <artifactId>pax-jdbc-pool-narayana</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.ops4j.pax.jdbc</groupId>
            <artifactId>pax-jdbc-pool-transx</artifactId>
            <scope>runtime</scope>
        </dependency>

        <!-- OSGi -->

        <dependency>
            <groupId>org.apache.karaf.features</groupId>
            <artifactId>framework</artifactId>
            <type>kar</type>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>*</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

    </dependencies>

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

            <!-- Core plugins -->

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>filter</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>resources</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- Tools -->

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy</id>
                        <phase>generate-resources</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- Karaf plugins -->

            <plugin>
                <groupId>org.apache.karaf.tooling</groupId>
                <artifactId>karaf-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>verify</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>verify</goal>
                        </goals>
                        <configuration>
                            <descriptors>
                                <descriptor>mvn:org.apache.karaf.features/framework/${version.org.apache.karaf}/xml/features</descriptor>
                                <descriptor>mvn:org.apache.karaf.features/standard/${version.org.apache.karaf}/xml/features</descriptor>
                                <descriptor>file:${project.build.directory}/classes/features.xml</descriptor>
                                <descriptor>file:${project.build.directory}/classes/features-gpl.xml</descriptor>
                            </descriptors>
                            <distribution>org.apache.karaf.features:framework</distribution>
                            <javase>1.8</javase>
                            <framework>
                                <feature>framework</feature>
                            </framework>
                            <features>
                                <feature>pax-jdbc-spec</feature>
                                <feature>pax-jdbc-config</feature>
<!--                                <feature>pax-jdbc-db2</feature>-->
<!--                                <feature>pax-jdbc-teradata</feature>-->
                                <feature>pax-jdbc-derby</feature>
                                <feature>pax-jdbc-derbyclient</feature>
                                <feature>pax-jdbc-h2</feature>
                                <feature>pax-jdbc-hsqldb</feature>
                                <feature>pax-jdbc-mysql</feature>
                                <feature>pax-jdbc-mariadb</feature>
                                <feature>pax-jdbc-oracle</feature>
                                <feature>pax-jdbc-postgresql</feature>
                                <feature>pax-jdbc-mssql</feature>
                                <feature>pax-jdbc-jtds</feature>
                                <feature>pax-jdbc-pool-dbcp2</feature>
                                <feature>pax-jdbc-pool-c3p0</feature>
                                <feature>pax-jdbc-pool-hikaricp</feature>
                                <feature>pax-jdbc-pool-aries</feature>
                                <feature>pax-jdbc-pool-narayana</feature>
                                <feature>pax-jdbc-pool-transx</feature>
                            </features>
                            <verifyTransitive>false</verifyTransitive>
                            <ignoreMissingConditions>true</ignoreMissingConditions>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <!-- MojoHaus plugins -->

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-artifacts</id>
                        <phase>package</phase>
                        <goals>
                            <goal>attach-artifact</goal>
                        </goals>
                        <configuration>
                            <artifacts>
                                <artifact>
                                    <file>target/classes/features.xml</file>
                                    <type>xml</type>
                                    <classifier>features</classifier>
                                </artifact>
                                <artifact>
                                    <file>target/classes/features-gpl.xml</file>
                                    <type>xml</type>
                                    <classifier>features-gpl</classifier>
                                </artifact>
                            </artifacts>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>

</project>
