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

    <groupId>de.gematik.demis</groupId>
    <artifactId>fhir-parser-library</artifactId>
    <version>2.7.0</version>
    <packaging>jar</packaging>
    <name>fhir-parser-library</name>
    <description>This library provides necessary dependencies to work with HAPI FHIR classes and a simple parser FHIR notifications in json or xml.</description>
    <url>https://github.com/gematik/DEMIS-FHIR-Parser-Library</url>

    <licenses>
        <license>
            <name>EUPL-1.2</name>
            <url>https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12</url>
        </license>
    </licenses>

    <properties>
        <version.maven.javadoc>3.12.0</version.maven.javadoc>
        <version.maven-compiler-plugin>3.14.1</version.maven-compiler-plugin>
        <maven.compiler.source>25</maven.compiler.source>
        <maven.compiler.target>25</maven.compiler.target>
        <hapi.version>8.6.0</hapi.version>
        <hl7.version>6.6.7</hl7.version>
        <jackson.version>2.21.1</jackson.version>
        <asm.version>9.9</asm.version>
        <fmt.maven.plugin.version>2.29</fmt.maven.plugin.version>
        <enforcer.plugin.version>3.6.2</enforcer.plugin.version>
        <surefire.plugin.version>3.5.4</surefire.plugin.version>
        <jacoco.plugin.version>0.8.14</jacoco.plugin.version>
        <guava.version>33.5.0-jre</guava.version>
        <slf4j.version>2.0.17</slf4j.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>${guava.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.datatype</groupId>
                <artifactId>jackson-datatype-jsr310</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.squareup.okio</groupId>
                <artifactId>okio</artifactId>
                <version>3.16.4</version>
            </dependency>
            <dependency>
                <groupId>com.squareup.okhttp3</groupId>
                <artifactId>okhttp</artifactId>
                <version>5.3.2</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>3.20.0</version>
            </dependency>
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>2.21.0</version>
            </dependency>
            <dependency>
                <artifactId>commons-codec</artifactId>
                <groupId>commons-codec</groupId>
                <version>1.20.0</version>
            </dependency>
            <dependency>
                <groupId>com.google.errorprone</groupId>
                <artifactId>error_prone_annotations</artifactId>
                <version>2.45.0</version>
            </dependency>
            <!-- HAPI FHIR Dependencies -->
            <dependency>
                <groupId>ca.uhn.hapi.fhir</groupId>
                <artifactId>hapi-fhir-base</artifactId>
                <version>${hapi.version}</version>
            </dependency>
            <dependency>
                <groupId>ca.uhn.hapi.fhir</groupId>
                <artifactId>hapi-fhir-structures-r4</artifactId>
                <version>${hapi.version}</version>
            </dependency>
            <!-- HL7 Dependencies -->
            <dependency>
                <groupId>ca.uhn.hapi.fhir</groupId>
                <artifactId>org.hl7.fhir.r4</artifactId>
                <version>${hl7.version}</version>
            </dependency>
            <dependency>
                <groupId>ca.uhn.hapi.fhir</groupId>
                <artifactId>org.hl7.fhir.utilities</artifactId>
                <version>${hl7.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>jcl-over-slf4j</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <!-- HAPI FHIR -->
        <dependency>
            <groupId>ca.uhn.hapi.fhir</groupId>
            <artifactId>hapi-fhir-structures-r4</artifactId>
            <version>${hapi.version}</version>
        </dependency>
        <dependency>
            <groupId>ca.uhn.hapi.fhir</groupId>
            <artifactId>hapi-fhir-base</artifactId>
            <version>${hapi.version}</version>
        </dependency>

        <!-- HL7 -->
        <dependency>
            <groupId>ca.uhn.hapi.fhir</groupId>
            <artifactId>org.hl7.fhir.r4</artifactId>
            <version>${hl7.version}</version>
        </dependency>
        <dependency>
            <groupId>ca.uhn.hapi.fhir</groupId>
            <artifactId>org.hl7.fhir.utilities</artifactId>
            <version>${hl7.version}</version>
        </dependency>

        <!--Test-->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>6.0.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <version>3.27.6</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <finalName>fhir-parser-library</finalName>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>2.7.0</version>
                <configuration>
                    <licenseName>eupl_v1_2</licenseName>
                    <inceptionYear>2025</inceptionYear>
                    <organizationName>gematik GmbH</organizationName>
                    <licenseResolver>classpath://copyright-header/eupl-license</licenseResolver>
                    <failOnMissingHeader>true</failOnMissingHeader>
                    <failOnNotUptodateHeader>true</failOnNotUptodateHeader>
                    <canUpdateCopyright>true</canUpdateCopyright>
                    <licensesOutputDirectory>${project.basedir}/third-party-licenses</licensesOutputDirectory>
                    <licensesOutputFile>${project.basedir}/third-party-licenses/licenses.xml</licensesOutputFile>
                    <forceDownload>false</forceDownload>
                    <includes>
                        <include>**/*.java</include>
                    </includes>
                    <excludes>
                        <exclude>**/generated/**</exclude>
                    </excludes>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>de.gematik</groupId>
                        <artifactId>ospo-resources</artifactId>
                        <version>1.3.2</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>download-licenses</id>
                        <goals>
                            <goal>download-licenses</goal>
                        </goals>
                        <phase>none</phase>
                    </execution>
                    <execution>
                        <id>update-file-header</id>
                        <goals>
                            <goal>update-file-header</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>check-file-header</id>
                        <goals>
                            <goal>check-file-header</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>${enforcer.plugin.version}</version>
                <executions>
                    <execution>
                        <id>enforce-maven</id>
                        <phase>process-sources</phase>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <banDuplicatePomDependencyVersions/>
                                <dependencyConvergence/>
                                <reactorModuleConvergence/>
                                <requireJavaVersion>
                                    <version>maven.compiler.target</version>
                                </requireJavaVersion>
                                <requireMavenVersion>
                                    <version>3.8</version>
                                </requireMavenVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.4.0</version>
            </plugin>

            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco.plugin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>generate-code-coverage-report</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${surefire.plugin.version}</version>
                <configuration>
                    <excludes>
                    </excludes>
                </configuration>
                <executions>
                    <execution>
                        <id>integration-test</id>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <phase>integration-test</phase>
                        <configuration>
                            <excludes>
                                <exclude>none</exclude>
                            </excludes>
                            <includes>
                                <include>**/*Test.java</include>
                            </includes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- Autoformat classes -->
            <plugin>
                <groupId>com.spotify.fmt</groupId>
                <artifactId>fmt-maven-plugin</artifactId>
                <version>${fmt.maven.plugin.version}</version>
                <executions>
                    <execution>
                        <id>format-code</id>
                        <phase>process-sources</phase>
                        <goals>
                            <goal>format</goal>
                        </goals>
                        <configuration>
                            <sourceDirectory>src/main/java</sourceDirectory>
                            <testSourceDirectory>src/test/java</testSourceDirectory>
                            <verbose>false</verbose>
                            <filesNamePattern>.*\.java</filesNamePattern>
                            <skip>false</skip>
                            <skipSortingImports>false</skipSortingImports>
                            <style>google</style>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- Use latest maven compiler plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${version.maven-compiler-plugin}</version>
                <executions>
                    <execution>
                        <id>default-compile</id>
                        <configuration>
                            <release>${maven.compiler.target}</release>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <showDeprecation>true</showDeprecation>
                    <showWarnings>true</showWarnings>
                    <source>${maven.compiler.source}</source>
                    <target>${maven.compiler.target}</target>
                    <fork>true</fork>
                    <meminitial>256</meminitial>
                    <maxmem>512</maxmem>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.ow2.asm</groupId>
                        <artifactId>asm</artifactId>
                        <version>${asm.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <!-- used to generate the NOTICE file -->
                <plugin>
                    <groupId>org.jasig.maven</groupId>
                    <artifactId>notice-maven-plugin</artifactId>
                    <version>2.0.0</version>
                    <configuration>
                        <noticeTemplate>NOTICE.template</noticeTemplate>
                        <outputDir>.</outputDir>
                    </configuration>
                    <executions>
                        <execution>
                            <id>notice-generation</id>
                            <goals>
                                <goal>generate</goal>
                            </goals>
                            <phase>generate-sources</phase>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <distributionManagement>
        <repository>
            <id>releases</id>
            <url>${releaseDeploymentRepository}</url>
        </repository>
        <snapshotRepository>
            <id>snapshots</id>
            <url>${snapshotDeploymentRepository}</url>
        </snapshotRepository>
    </distributionManagement>

    <profiles>
        <profile>
            <id>external</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.2.8</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>0.9.0</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                            <autoPublish>true</autoPublish>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.3.1</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${version.maven.javadoc}</version>
                        <configuration>
                            <doclint>none</doclint>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <scm>
        <url>https://github.com/gematik/DEMIS-FHIR-Parser-Library</url>
        <connection>scm:git:git://github.com/gematik/DEMIS-FHIR-Parser-Library.git</connection>
        <developerConnection>scm:git:ssh://git@github.com:gematik/DEMIS-FHIR-Parser-Library.git</developerConnection>
    </scm>

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/gematik/DEMIS-FHIR-Parser-Library</url>
    </issueManagement>

    <organization>
        <name>gematik GmbH</name>
        <url>https://www.gematik.de</url>
    </organization>

    <developers>
        <developer>
            <name>gematik</name>
            <email>software-development@gematik.de</email>
            <url>https://gematik.github.io/</url>
            <organization>gematik GmbH</organization>
            <organizationUrl>https://www.gematik.de/</organizationUrl>
        </developer>
    </developers>
</project>
