<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (C) 2017-2022 Evolveum
  ~
  ~ 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
  ~
  ~     https://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>

    <groupId>com.evolveum.midpoint.client</groupId>
    <artifactId>parent</artifactId>
    <version>4.10</version>
    <packaging>pom</packaging>

    <modules>
        <module>midpoint-client-api</module>
        <module>midpoint-client-impl-rest-jaxb</module>
        <module>midpoint-client-impl-prism</module>
    </modules>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.source.version>17</project.source.version>

        <midpoint.version>4.10</midpoint.version>

        <testng.version>7.10.2</testng.version>
        <cxf.version>4.0.9</cxf.version>
        <!-- Normally both versions are the same but sometimes databind is patched and core stays. -->
        <jackson.version>2.18.1</jackson.version>
        <jackson-databind.version>2.18.1</jackson-databind.version>
        <httpclient.version>5.4.4</httpclient.version>
        <jaxb-api.version>3.0.0</jaxb-api.version>
        <jaxb.version>3.0.2</jaxb.version>
        <activation.version>2.1.3</activation.version>
        <surefire.version>3.5.2</surefire.version>
        <jakarta.annotation.version>3.0.0</jakarta.annotation.version>
        <commons-lang3.version>3.18.0</commons-lang3.version>
        <jakarta.ws.rs-api.version>4.0.0</jakarta.ws.rs-api.version>
    </properties>

    <scm>
        <connection>https://github.com/Evolveum/midpoint-client-java.git</connection>
        <developerConnection>git@github.com:Evolveum/midpoint-client-java.git</developerConnection>
    </scm>

    <distributionManagement>
        <repository>
            <id>evolveum-nexus</id>
            <name>Internal Releases</name>
            <url>https://nexus.evolveum.com/nexus/content/repositories/releases/</url>
        </repository>

        <snapshotRepository>
            <id>evolveum-nexus</id>
            <name>Internal Releases</name>
            <url>https://nexus.evolveum.com/nexus/content/repositories/snapshots/</url>
        </snapshotRepository>
    </distributionManagement>

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

    <pluginRepositories>
        <pluginRepository>
            <id>evolveum</id>
            <name>Evolveum</name>
            <url>https://nexus.evolveum.com/nexus/content/groups/public</url>
        </pluginRepository>
    </pluginRepositories>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.testng</groupId>
                <artifactId>testng</artifactId>
                <version>${testng.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-core</artifactId>
                <version>${cxf.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-rt-rs-client</artifactId>
                <version>${cxf.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-rt-transports-local</artifactId>
                <version>${cxf.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.cxf</groupId>
                <artifactId>cxf-rt-transports-http-jetty</artifactId>
                <version>${cxf.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-core</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${jackson-databind.version}</version>
            </dependency>
            <dependency>
                <groupId>jakarta.xml.bind</groupId>
                <artifactId>jakarta.xml.bind-api</artifactId>
                <version>${jaxb-api.version}</version>
            </dependency>
            <dependency>
                <groupId>jakarta.xml.bind-api</groupId>
                <artifactId>jakarta.xml.bind-impl</artifactId>
                <version>${jaxb.version}</version>
            </dependency>
            <dependency>
                <groupId>jakarta.ws.rs</groupId>
                <artifactId>jakarta.ws.rs-api</artifactId>
                <version>${jakarta.ws.rs-api.version}</version>
            </dependency>
            <dependency>
                <groupId>com.sun.xml.bind</groupId>
                <artifactId>jaxb-core</artifactId>
                <version>${jaxb.version}</version>
            </dependency>
            <dependency>
                <groupId>jakarta.activation</groupId>
                <artifactId>jakarta.activation-api</artifactId>
                <version>${activation.version}</version>
            </dependency>
            <dependency>
                <groupId>jakarta.annotation</groupId>
                <artifactId>jakarta.annotation-api</artifactId>
                <version>${jakarta.annotation.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>${commons-lang3.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.13.0</version>
                    <configuration>
                        <source>${project.source.version}</source>
                        <target>${project.source.version}</target>
                        <fork>false</fork>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.3.1</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${surefire.version}</version>
                    <configuration>
                        <suiteXmlFiles>
                            <suiteXmlFile>testng-unit.xml</suiteXmlFile>
                        </suiteXmlFiles>
                        <properties>
                            <property>
                                <name>suitename</name>
                                <value>unit</value>
                            </property>
                        </properties>
                        <useSystemClassLoader>false</useSystemClassLoader>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.apache.maven.surefire</groupId>
                            <artifactId>surefire-testng</artifactId>
                            <version>${surefire.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <groupId>org.cyclonedx</groupId>
                    <artifactId>cyclonedx-maven-plugin</artifactId>
                    <configuration>
                        <projectType>library</projectType>
                    </configuration>
                    <executions>
                        <execution>
                            <id>sbom-package</id>
                            <phase>package</phase>
                            <goals>
                                <goal>makeBom</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <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>
        </pluginManagement>
    </build>
    <dependencies>
        <dependency> <!-- Not used, but required for surefire plugin not to complain -->
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>intest</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>${surefire.version}</version>
                        <configuration>
                            <suiteXmlFiles>
                                <suiteXmlFile>testng-integration.xml</suiteXmlFile>
                            </suiteXmlFiles>
                            <properties>
                                <property>
                                    <name>suitename</name>
                                    <value>Integration</value>
                                </property>
                            </properties>
                            <useSystemClassLoader>false</useSystemClassLoader>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
