<?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">
    <modelVersion>4.0.0</modelVersion>

    <artifactId>gooddata-java-parent</artifactId>
    <packaging>pom</packaging>
    <version>4.0.3+api3</version>
    <name>${project.artifactId}</name>
    <description>GoodData Java SDK</description>
    <url>https://github.com/gooddata/gooddata-java</url>

    <parent>
        <groupId>com.gooddata</groupId>
        <artifactId>gooddata-parent</artifactId>
        <version>4.0.3</version>
    </parent>

    <licenses>
        <license>
            <name>BSD License</name>
            <url>http://opensource.org/licenses/BSD-3-Clause</url>
        </license>
    </licenses>

    <scm>
        <url>git@github.com:gooddata/gooddata-java.git</url>
        <connection>scm:git:git@github.com:gooddata/gooddata-java.git</connection>
        <developerConnection>scm:git:git@github.com:gooddata/gooddata-java.git</developerConnection>
        <tag>gooddata-java-parent-4.0.3+api3</tag>
    </scm>

    <developers>
        <developer>
            <name>Martin Caslavsky</name>
        </developer>
        <developer>
            <name>Libor Rysavy</name>
        </developer>
        <developer>
            <name>Jiri Mikulasek</name>
        </developer>
    </developers>

    <modules>
        <module>gooddata-java-model</module>
        <module>gooddata-java</module>
    </modules>

    <properties>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>

        <slf4j.version>2.0.9</slf4j.version>
        <spring.version>6.0.15</spring.version>
        <spring-boot.version>3.0.13</spring-boot.version>
        <junit.version>5.10.0</junit.version>
        <groovy.version>4.0.22</groovy.version>
        <jadler.version>1.3.1</jadler.version>
        <jetty.compatible.version>8.1.22.v20160922</jetty.compatible.version>
        <json-unit.version>2.38.0</json-unit.version>
        <surefire.version>3.1.2</surefire.version>
        <failsafe.version>3.1.2</failsafe.version>
        <httpclient.version>4.5.14</httpclient.version>
        <httpcore.version>4.4.16</httpcore.version>

        <!-- Hardcoded value, so the license:check doesn't break builds at the New Year.
        Change to current year value together with headers in all source files and first license in LICENSE.txt. -->
        <currentYear>2025</currentYear>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.gmavenplus</groupId>
                    <artifactId>gmavenplus-plugin</artifactId>
                    <version>3.0.2</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>addTestSources</goal>
                                <goal>compileTests</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>3.6.0</version>
                    <configuration>
                        <failOnWarning>false</failOnWarning>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>${failsafe.version}</version>
                <configuration>
                    <threadCount>1</threadCount>
                    <!-- Re-enable IT tests with improved Jetty dependency management -->
                    <includes>
                        <include>**/*IT.java</include>
                    </includes>
                    <!-- Exclude problematic tests if any -->
                    <excludes>
                        <!-- Add specific problematic tests here if needed -->
                        <!-- <exclude>**/ProblematicIT.java</exclude> -->
                    </excludes>
                    <!-- Enhanced system properties for Jetty compatibility -->
                    <systemPropertyVariables>
                        <jetty.version.forced>true</jetty.version.forced>
                        <org.eclipse.jetty.util.log.class>org.eclipse.jetty.util.log.StdErrLog</org.eclipse.jetty.util.log.class>
                        <org.eclipse.jetty.LEVEL>WARN</org.eclipse.jetty.LEVEL>
                    </systemPropertyVariables>
                </configuration>
                <dependencies>
                    <!-- Use TestNG for IT tests instead of JUnit -->
                    <dependency>
                        <groupId>org.apache.maven.surefire</groupId>
                        <artifactId>surefire-testng</artifactId>
                        <version>${failsafe.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>findbugs-maven-plugin</artifactId>
                <version>3.0.5</version>
                <configuration>
                    <excludeFilterFile>findBugsFilter.xml</excludeFilterFile>
                    <skip>true</skip>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <phase>test</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>3.0</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <configuration>
                            <inlineHeader>(C) ${currentYear} GoodData Corporation.
This source code is licensed under the BSD-style license found in the
LICENSE.txt file in the root directory of this source tree.</inlineHeader>
                            <failIfMissing>true</failIfMissing>
                            <failIfUnknown>true</failIfUnknown>
                            <skipExistingHeaders>true</skipExistingHeaders>
                            <properties>
                                <currentYear>${currentYear}</currentYear>
                            </properties>
                            <includes>
                                <include>src/**/*.java</include>
                                <include>src/**/*.scala</include>
                                <include>src/**/*.groovy</include>
                                <include>src/**/*.kt</include>
                            </includes>
                            <mapping>
                                <java>SLASHSTAR_STYLE</java>
                                <scala>SLASHSTAR_STYLE</scala>
                                <groovy>SLASHSTAR_STYLE</groovy>
                                <kt>SLASHSTAR_STYLE</kt>
                            </mapping>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <inlineHeader>(C) ${currentYear} GoodData Corporation.
This source code is licensed under the BSD-style license found in the
LICENSE.txt file in the root directory of this source tree.</inlineHeader>
                    <failIfMissing>true</failIfMissing>
                    <failIfUnknown>true</failIfUnknown>
                    <skipExistingHeaders>true</skipExistingHeaders>
                    <properties>
                        <currentYear>${currentYear}</currentYear>
                    </properties>
                    <includes>
                        <include>src/**/*.java</include>
                        <include>src/**/*.scala</include>
                        <include>src/**/*.groovy</include>
                        <include>src/**/*.kt</include>
                    </includes>
                    <mapping>
                        <java>SLASHSTAR_STYLE</java>
                        <scala>SLASHSTAR_STYLE</scala>
                        <groovy>SLASHSTAR_STYLE</groovy>
                        <kt>SLASHSTAR_STYLE</kt>
                    </mapping>
                </configuration>
            </plugin>
            <plugin>
                <!-- needed to make running both Spock and JUnit5 tests -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${surefire.version}</version>
                <configuration>
                    <threadCount>1</threadCount>
                    <includes>
                        <include>**/*Test.java</include>
                        <include>**/*Spec.groovy</include>
                    </includes>
                    <excludes>
                        <exclude>**/RetryableRestTemplateTest.java</exclude>
                    </excludes>
                    <argLine>--add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED</argLine>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>at</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <skip>true</skip>
                        </configuration>
                    </plugin>
                    <plugin>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>integration-test</goal>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <excludedGroups>isolated_domain</excludedGroups>
                            <includes>
                                <include>**/*AT.java</include>
                            </includes>
                            <!-- Explicitly set Java 17 for forked processes -->
                            <jvm>${java.home}/bin/java</jvm>
                            <argLine>-Xmx2g</argLine>
                        </configuration>
                        <dependencies>
                            <dependency>
                                <groupId>org.apache.maven.surefire</groupId>
                                <artifactId>surefire-testng</artifactId>
                                <version>${failsafe.version}</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>coverage</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>0.8.8</version>
                        <executions>
                            <execution>
                                <id>jacoco-prepare-agent</id>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>jacoco-prepare-agent-integration</id>
                                <goals>
                                    <goal>prepare-agent-integration</goal>
                                </goals>
                                <configuration>
                                    <destFile>${project.build.directory}/jacoco.exec</destFile>
                                    <append>true</append>
                                </configuration>
                            </execution>
                            <execution>
                                <id>jacoco-report</id>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>jacoco-check</id>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                                <configuration>
                                    <rules />
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <dependencyManagement>
        <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-dependencies</artifactId>
            <version>${spring-boot.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>            <!-- Override specific versions where needed -->
            

            <!-- Use HttpClient 4.x with Spring 6 compatibility layer -->
            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpclient</artifactId>
                <version>${httpclient.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpcore</artifactId>
                <version>${httpcore.version}</version>
            </dependency>

            
            <dependency>
                <groupId>com.gooddata</groupId>
                <artifactId>gooddata-rest-common</artifactId>
                <version>2.0.1</version>
                <exclusions>
                    <exclusion>
                        <groupId>joda-time</groupId>
                        <artifactId>joda-time</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-core</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-web</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>com.gooddata</groupId>
                <artifactId>gooddata-http-client</artifactId>
                <version>1.0.0</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>3.17.0</version>
            </dependency>
            <dependency>
                <groupId>com.github.lookfirst</groupId>
                <artifactId>sardine</artifactId>
                <version>5.10</version>
                <optional>true</optional>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>

            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>2.18.0</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.testng</groupId>
                <artifactId>testng</artifactId>
                <version>7.11.0</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>5.5.0</version>
                <scope>test</scope>
                <exclusions>
                    <exclusion>
                        <groupId>org.hamcrest</groupId>
                        <artifactId>hamcrest-core</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-junit-jupiter</artifactId>
                <version>5.5.0</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest</artifactId>
                <version>2.2</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>net.javacrumbs.json-unit</groupId>
                <artifactId>json-unit</artifactId>
                <version>${json-unit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>net.javacrumbs.json-unit</groupId>
                <artifactId>json-unit-core</artifactId>
                <version>${json-unit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-simple</artifactId>
                <version>${slf4j.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>net.jadler</groupId>
                <artifactId>jadler-core</artifactId>
                <version>${jadler.version}</version>
                <scope>test</scope>
                <exclusions>
                    <exclusion>
                        <groupId>org.hamcrest</groupId>
                        <artifactId>hamcrest-library</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.eclipse.jetty</groupId>
                        <artifactId>jetty-server</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.eclipse.jetty</groupId>
                        <artifactId>jetty-servlet</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>net.jadler</groupId>
                <artifactId>jadler-all</artifactId>
                <version>${jadler.version}</version>
                <scope>test</scope>
                <exclusions>
                    <exclusion>
                        <groupId>org.eclipse.jetty</groupId>
                        <artifactId>jetty-server</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.eclipse.jetty</groupId>
                        <artifactId>jetty-servlet</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <!-- Enhanced Jetty dependencies management for Jadler compatibility with Spring Boot 3 -->
            <!-- Force specific Jetty versions that work with both Spring Boot 3 and Jadler -->
            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-server</artifactId>
                <version>${jetty.compatible.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-servlet</artifactId>
                <version>${jetty.compatible.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-util</artifactId>
                <version>${jetty.compatible.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-http</artifactId>
                <version>${jetty.compatible.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-io</artifactId>
                <version>${jetty.compatible.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-security</artifactId>
                <version>${jetty.compatible.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-webapp</artifactId>
                <version>${jetty.compatible.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>com.shazam</groupId>
                <artifactId>shazamcrest</artifactId>
                <version>0.11</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>nl.jqno.equalsverifier</groupId>
                <artifactId>equalsverifier</artifactId>
                <version>3.10.1</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.spockframework</groupId>
                <artifactId>spock-core</artifactId>
                <version>2.4-M1-groovy-4.0</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.groovy</groupId>
                <artifactId>groovy</artifactId>
                <version>${groovy.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>cglib</groupId>
                <artifactId>cglib-nodep</artifactId>
                <version>3.3.0</version>
                <scope>test</scope>
            </dependency>

        </dependencies>
    </dependencyManagement>

</project>
