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

    <name>${project.groupId}:${project.artifactId}</name>
    <description>Java based pipeline framework to interact with Linked Data</description>
    <url>https://informatievlaanderen.github.io/VSDS-Linked-Data-Interactions/</url>

    <groupId>be.vlaanderen.informatievlaanderen.ldes</groupId>
    <artifactId>linked-data-interactions</artifactId>
    <packaging>pom</packaging>
    <version>2.12.0</version>

    <modules>
        <module>ldi-api</module>
        <module>ldi-core</module>
        <module>ldi-orchestrator</module>
        <module>ldi-nifi</module>
        <module>ldi-extensions</module>
    </modules>

    <developers>
        <developer>
            <name>Yalz</name>
            <email>Yalz@users.noreply.github.com</email>
            <organization>Cegeka</organization>
            <organizationUrl>http://www.sonatype.com</organizationUrl>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>EUPL</name>
            <url>https://eupl.eu/1.2/en</url>
        </license>
    </licenses>

    <properties>
        <java.version>21</java.version>
        <maven.compiler.source>21</maven.compiler.source>
        <maven.compiler.target>21</maven.compiler.target>
        <maven.compiler.release>21</maven.compiler.release>

        <maven-javadoc-plugin.version>3.5.0</maven-javadoc-plugin.version>
        <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
        <maven-install-plugin.version>2.5.2</maven-install-plugin.version>
        <nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>
        <maven-surefire-plugin.version>3.1.2</maven-surefire-plugin.version>
        <maven-failsafe-plugin.version>3.0.0-M7</maven-failsafe-plugin.version>
        <maven-jar-plugin.version>3.4.2</maven-jar-plugin.version>
        <maven-release-plugin.version>3.0.1</maven-release-plugin.version>
        <maven-assembly-plugin.version>3.6.0</maven-assembly-plugin.version>
        <maven-gpg-plugin.version>3.1.0</maven-gpg-plugin.version>
        <unittestskip>false</unittestskip>
        <integrationtestskip>false</integrationtestskip>

        <!-- PERSISTENCE -->
        <sqlite-jdbc.version>3.43.0.0</sqlite-jdbc.version>
        <sqlite-dialect.version>0.1.4</sqlite-dialect.version>
        <hibernate.version>5.6.15.Final</hibernate.version>
        <javax-validation.version>2.0.1.Final</javax-validation.version>
        <javax.version>2.2</javax.version>
        <hikari.version>5.0.1</hikari.version>
        <postgresql.version>42.6.0</postgresql.version>

        <jena.version>5.1.0</jena.version>
        <sis-embedded-db.version>1.4</sis-embedded-db.version>
        <xml-bind.version>4.0.1</xml-bind.version>
        <jackson.version>2.15.3</jackson.version>
        <rdf-urdna.version>1.3</rdf-urdna.version>
        <apache-httpclient.version>5.3.1</apache-httpclient.version>

        <!-- LOGGING -->
        <micrometer-prometheus.version>1.12.0</micrometer-prometheus.version>
        <micrometer-tracing.version>1.2.0</micrometer-tracing.version>
        <zipkin-reporter.version>2.16.4</zipkin-reporter.version>
        <loki.version>1.4.2</loki.version>

        <!-- Testing -->
        <assertj.version>3.24.2</assertj.version>
        <junit-jupiter.version>5.10.2</junit-jupiter.version>
        <junit-platform-suite.version>1.10.2</junit-platform-suite.version>
        <awaitility.version>4.2.0</awaitility.version>
        <byte-buddy.version>1.14.12</byte-buddy.version>
        <wiremock-jre8.version>2.35.1</wiremock-jre8.version>
        <mockito-core.version>5.14.2</mockito-core.version>
        <mockito-junit.version>5.14.2</mockito-junit.version>
        <cucumber.version>7.20.1</cucumber.version>
        <testcontainers.version>1.19.6</testcontainers.version>
        <testcontainers-postgresql.version>1.20.2</testcontainers-postgresql.version>
        <slf4j.version>2.0.7</slf4j.version>
        <logback-classic.version>1.4.11</logback-classic.version>
        <!-- Jacoco -->
        <jacoco.version>0.8.12</jacoco.version>
        <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
        <sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
        <sonar.coverage.jacoco.xmlReportPaths>${project.basedir}/target/site/jacoco/jacoco.xml
        </sonar.coverage.jacoco.xmlReportPaths>
        <sonar.language>java</sonar.language>
        <sonar.host.url>https://sonarcloud.io</sonar.host.url>
        <sonar.organization>informatievlaanderen</sonar.organization>
        <sonar.projectKey>Informatievlaanderen_VSDS-Linked-Data-Interactions-${project.groupId}:${project.artifactId}
        </sonar.projectKey>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>${maven-gpg-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                </plugin>
                <!-- JACOCO -->
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${jacoco.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <skip>${unittestskip}</skip>
                    <environmentVariables>
                        <SIS_DATA>./</SIS_DATA>
                    </environmentVariables>
                    <includes>
                        <include>**/*Test.java</include>
                    </includes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <configuration>
                    <skip>${integrationtestskip}</skip>
                    <includes>
                        <include>**/*IT.java</include>
                    </includes>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- Override version for maven-install-plugin because there is a bug in
                 3.0.0-M1 preventing installing of modules with packaging of feature
                 see: https://issues.apache.org/jira/browse/MINSTALL-151 -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-install-plugin</artifactId>
                <version>${maven-install-plugin.version}</version>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>${maven-release-plugin.version}</version>
                <configuration>
                    <scmCommentPrefix>[ci skip]</scmCommentPrefix>
                    <tagNameFormat>@{project.version}</tagNameFormat>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>deploy</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                        <configuration>
                            <gpgArguments>
                                <arg>--pinentry-mode</arg>
                                <arg>loopback</arg>
                            </gpgArguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencyManagement>
        <dependencies>
            <!-- LDI components -->
            <dependency>
                <groupId>be.vlaanderen.informatievlaanderen.ldes.ldi</groupId>
                <artifactId>ldi-api</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>be.vlaanderen.informatievlaanderen.ldes.ldi</groupId>
                <artifactId>ldi-common</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>be.vlaanderen.informatievlaanderen.ldes.ldi</groupId>
                <artifactId>ldi-infra-sql</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>be.vlaanderen.informatievlaanderen.ldes.client</groupId>
                <artifactId>event-stream-properties-fetcher</artifactId>
                <version>${project.version}</version>
            </dependency>


            <dependency>
                <groupId>org.apache.jena</groupId>
                <artifactId>jena-arq</artifactId>
                <version>${jena.version}</version>
            </dependency>
            <dependency>
                <groupId>io.setl</groupId>
                <artifactId>rdf-urdna</artifactId>
                <version>${rdf-urdna.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.httpcomponents.core5</groupId>
                <artifactId>httpcore5</artifactId>
                <version>${apache-httpclient.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${jackson.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-annotations</artifactId>
                <version>${jackson.version}</version>
            </dependency>

            <!-- Logging -->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>io.micrometer</groupId>
                <artifactId>micrometer-registry-prometheus</artifactId>
                <version>${micrometer-prometheus.version}</version>
            </dependency>
            <dependency>
                <groupId>io.micrometer</groupId>
                <artifactId>micrometer-tracing-bridge-otel</artifactId>
                <version>${micrometer-tracing.version}</version>
            </dependency>
            <dependency>
                <groupId>io.zipkin.reporter2</groupId>
                <artifactId>zipkin-reporter-brave</artifactId>
                <version>${zipkin-reporter.version}</version>
            </dependency>
            <dependency>
                <groupId>com.github.loki4j</groupId>
                <artifactId>loki-logback-appender</artifactId>
                <version>${loki.version}</version>
            </dependency>

            <!-- Testing -->
            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>${assertj.version}</version>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter</artifactId>
                <version>${junit-jupiter.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-params</artifactId>
                <version>${junit-jupiter.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-api</artifactId>
                <version>${junit-jupiter.version}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>net.bytebuddy</groupId>
                <artifactId>byte-buddy</artifactId>
                <version>${byte-buddy.version}</version>
            </dependency>
            <dependency>
                <groupId>org.awaitility</groupId>
                <artifactId>awaitility</artifactId>
                <version>${awaitility.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>com.github.tomakehurst</groupId>
                <artifactId>wiremock-jre8</artifactId>
                <version>${wiremock-jre8.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito-core.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-junit-jupiter</artifactId>
                <version>${mockito-junit.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <profiles>
        <profile>
            <id>coverage</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>${jacoco.version}</version>
                        <configuration>
                            <excludes>
                                <exclude>META-INF/**</exclude>
                                <exclude>**/CustomHTTPRepositoryConnection.java</exclude>
                                <exclude>**/GraphExtract.java</exclude>
                                <exclude>**/TripleBoundary.java</exclude>
                                <exclude>**/ModelExtract.java</exclude>
                                <exclude>**/StatementBoundary.java</exclude>
                                <exclude>**/StatementBoundaryBase.java</exclude>
                                <exclude>**/StatementTripleBoundary.java</exclude>
                            </excludes>
                        </configuration>
                        <executions>
                            <execution>
                                <id>prepare-agent</id>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>report</id>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                                <configuration>
                                    <formats>
                                        <format>XML</format>
                                    </formats>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <!-- RELEASE PREP -->

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${maven-javadoc-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-javadoc</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${maven-source-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-source</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>${nexus-staging-maven-plugin.version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://s01.oss.sonatype.org</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <scm>
        <connection>scm:git:${project.scm.url}</connection>
        <developerConnection>scm:git:${project.scm.url}</developerConnection>
        <url>git@github.com:Informatievlaanderen/VSDS-Linked-Data-Interactions.git</url>
        <tag>HEAD</tag>
    </scm>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>
</project>
