<?xml version="1.0" encoding="UTF-8"?>
<!--
 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.

 Copyright (C) 2014-2022 Evolveum All rights reserved.

 The contents of this file are subject to the terms of the Common Development
 and Distribution License("CDDL") (the "License").  You may not use this file
 except in compliance with the License.

 You can obtain a copy of the License at
 https://opensource.org/licenses/cddl1.php
 See the License for the specific language governing permissions and limitations
 under the License.

 When distributing the Covered Code, include this CDDL Header Notice in each file
 and include the License file at https://opensource.org/licenses/cddl1.php.
 If applicable, add the following below this CDDL Header, with the fields
 enclosed by brackets [] replaced by your own identifying information:
 "Portions Copyrighted [year] [name of copyright owner]"
-->
<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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.evolveum.polygon</groupId>
        <artifactId>connector-parent</artifactId>
        <version>1.5.2.0</version>
    </parent>

    <artifactId>connector-databasetable</artifactId>
    <version>1.5.3.0</version>
    <packaging>jar</packaging>

    <name>Database Table Connector</name>
    <description>Database table connector which uses a single database table to store the Account records.</description>

    <url>https://wiki.evolveum.com/display/midPoint/DatabaseTable+Connector</url>
    <scm>
        <connection>https://github.com/Evolveum/openicf.git</connection>
        <developerConnection>git@github.com:Evolveum/openicf.git</developerConnection>
        <url>https://github.com/Evolveum/openicf.git</url>
    </scm>
    <issueManagement>
        <system>jira</system>
        <url>https://jira.evolveum.com</url>
    </issueManagement>

    <properties>
        <java.version>17</java.version>
        <project.source.version>${java.version}</project.source.version>
        <project.target.version>${java.version}</project.target.version>
        <derby.version>10.17.1.0</derby.version>

        <connectorPackage>org.identityconnectors.databasetable</connectorPackage>
        <connectorClass>DatabaseTableConnector</connectorClass>
    </properties>

    <repositories>
        <repository>
            <id>evolveum</id>
            <name>Evolveum Public Releases</name>
            <url>https://nexus.evolveum.com/nexus/content/groups/public</url>
        </repository>
        <repository>
            <id>evolveum-snapshots</id>
            <name>Evolveum Snapshots</name>
            <url>https://nexus.evolveum.com/nexus/content/repositories/snapshots/</url>
        </repository>
    </repositories>
    <dependencies>
        <dependency>
            <groupId>com.evolveum.polygon</groupId>
            <artifactId>dbcommon</artifactId>
            <version>2.3</version>
        </dependency>

        <!-- Java 9 and higher -->
        <!-- Derby test dependencies-->
        <dependency>
            <groupId>org.apache.derby</groupId>
            <artifactId>derby</artifactId>
            <version>${derby.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.derby</groupId>
            <artifactId>derbytools</artifactId>
            <version>${derby.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>**/DatabaseTableOracleTests.java</exclude> <!-- enable if needed -->
                        <exclude>**/DatabaseTablePostgreSQLTests.java</exclude> <!-- enable if needed -->
                    </excludes>
                </configuration>
                <!-- surefire-testng dependency needed until common-parent is updated to 1.5.3.0-SNAPSHOT at least -->
                <!-- reason: maven by default uses junit platform therefore all testng tests are skipped silently -->
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.surefire</groupId>
                        <artifactId>surefire-testng</artifactId>
                        <version>3.5.1</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>sbom</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.cyclonedx</groupId>
                        <artifactId>cyclonedx-maven-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sbom-package</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>makeBom</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>dependencytrack</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>io.github.pmckeown</groupId>
                        <artifactId>dependency-track-maven-plugin</artifactId>
                        <version>1.7.0</version>
                        <configuration>
                            <dependencyTrackBaseUrl>${env.DTRACK_URL}</dependencyTrackBaseUrl>
                            <apiKey>${env.DTRACK_TOKEN}</apiKey>
                        </configuration>
                        <executions>
                            <execution>
                                <id>upload-bom</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>upload-bom</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
