<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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <modules>
    <module>commons</module>
    <module>valmodule-base</module>
    <module>valmodule-erp</module>
    <module>valmodule-eau</module>
    <module>core</module>
    <module>valmodule-core</module>
    <module>valmodule-erpta7</module>
  </modules>

  <groupId>de.gematik.refv</groupId>
  <artifactId>referencevalidator</artifactId>
  <packaging>pom</packaging>
  <version>2.14.1</version>
  <name>gematik Referenzvalidator</name>
  <description>Der Referenzvalidator ermöglicht eine erweiterte Validierung von FHIR-Ressourcen, die in den Anwendungen der Telematikinfrastruktur (TI) verwendet werden. Der Referenzvalidator liefert autoritative Antworten zur Validität von übertragenen Datensätzen und ist somit eine Referenz für eventuell sonst im Rahmen einer TI-Anwendung eingesetzte FHIR-Validatoren.</description>
  <url>https://github.com/gematik/app-referencevalidator</url>

  <scm>
    <url>https://github.com/gematik/app-referencevalidator</url>
    <connection>scm:git:git://github.com/gematik/app-referencevalidator.git</connection>
    <developerConnection>scm:git:ssh://git@github.com:gematik/app-referencevalidator.git</developerConnection>
  </scm>

  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/gematik/app-referencevalidator/issues</url>
  </issueManagement>

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

  <licenses>
    <license>
      <name>Apache License 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

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

  <distributionManagement>
    <repository>
      <id>releases</id>
      <!--suppress UnresolvedMavenProperty -->
      <url>${releaseDeploymentRepository}</url>
    </repository>
    <snapshotRepository>
      <id>snapshots</id>
      <!--suppress UnresolvedMavenProperty -->
      <url>${snapshotDeploymentRepository}</url>
    </snapshotRepository>
  </distributionManagement>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.encoding>UTF-8</maven.compiler.encoding>
    <maven.compiler.release>11</maven.compiler.release>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</maven.compiler.target>
    <version.surefire>3.5.4</version.surefire>
    <version.compiler>3.14.1</version.compiler>
    <version.hapi-fhir-validation>6.6.2</version.hapi-fhir-validation>
    <version.lombok>1.18.42</version.lombok>
    <version.log4j2>2.25.2</version.log4j2>
    <version.slf4j-api>2.0.17</version.slf4j-api>
    <version.slf4j-log4j>2.0.17</version.slf4j-log4j>
    <version.junit-jupiter-api>6.0.1</version.junit-jupiter-api>
    <version.jackson>2.19.1</version.jackson>
    <version.woodstox>7.1.1</version.woodstox>
    <version.site>3.21.0</version.site>
    <version.maven-release>3.3.1</version.maven-release>
    <version.jar>3.5.0</version.jar>
    <version.build.helper>3.6.1</version.build.helper>
    <version.maven-source-plugin>3.4.0</version.maven-source-plugin>
    <version.maven-javadoc-plugin>3.12.0</version.maven-javadoc-plugin>
    <version.maven-assembly-plugin>3.8.0</version.maven-assembly-plugin>
    <version.buildnumber>3.2.1</version.buildnumber>
    <version.picocli>4.7.7</version.picocli>
    <version.jacoco>0.8.14</version.jacoco>
    <version.maven-failsafe-plugin>3.5.4</version.maven-failsafe-plugin>
    <version.maven-enforcer-plugin>3.6.2</version.maven-enforcer-plugin>
    <version.exec-maven-plugin>3.6.2</version.exec-maven-plugin>
    <version.snakeyaml>2.5</version.snakeyaml>
    <license-maven-plugin.version>2.7.0</license-maven-plugin.version>
    <ospo-resources.version>1.3.2</ospo-resources.version>

    <sonar.coverage.jacoco.xmlReportPaths>**/site/jacoco-it/jacoco.xml,**/site/jacoco/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
    <sonar.junit.reportPaths>
      target/surefire-reports,target/failsafe-reports/
    </sonar.junit.reportPaths>
    <central-publishing-maven-plugin.version>0.9.0</central-publishing-maven-plugin.version>
    <version.maven-gpg-plugin>3.2.8</version.maven-gpg-plugin>
    <assertj-core.version>3.27.7</assertj-core.version>
    <version.snapshot-generator>0.6.0</version.snapshot-generator>
    <spotless-maven-plugin.version>2.46.1</spotless-maven-plugin.version>
    <version.maven-resources>3.4.0</version.maven-resources>
    <commons-compress.version>1.28.0</commons-compress.version>
    <guava.version>33.5.0-jre</guava.version>
    <thymeleaf.version>3.1.3.RELEASE</thymeleaf.version>
    <checker-qual.version>3.52.1</checker-qual.version>
    <commons-codec.version>1.20.0</commons-codec.version>
    <error_prone_annotations.version>2.45.0</error_prone_annotations.version>
    <commons-io.version>2.21.0</commons-io.version>
    <commons-lang3.version>3.20.0</commons-lang3.version>
    <commons-text.version>1.15.0</commons-text.version>
  </properties>



  <build>
    <plugins>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>${version.jacoco}</version>
        <executions>
          <execution>
            <id>default-prepare-agent</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>default-prepare-agent-integration</id>
            <goals>
              <goal>prepare-agent-integration</goal>
            </goals>
          </execution>
          <execution>
            <id>default-report</id>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
          <execution>
            <id>default-report-integration</id>
            <goals>
              <goal>report-integration</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${version.compiler}</version>
        <configuration>
          <debug>true</debug>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>${version.maven-source-plugin}</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${version.surefire}</version>
        <configuration>
          <excludes>
            <exclude>**/*LocalTest.java</exclude>
            <exclude>**/*IT.java</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>${version.maven-failsafe-plugin}</version>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>${version.maven-enforcer-plugin}</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.release}</version>
                </requireJavaVersion>
                <requireMavenVersion>
                  <version>3.8</version>
                </requireMavenVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>${license-maven-plugin.version}</version>
        <configuration>
          <licenseName>apache_v2_0</licenseName>
          <licenseResolver>classpath://copyright-header/apache-license</licenseResolver>
          <inceptionYear>2025</inceptionYear>
          <organizationName>gematik GmbH</organizationName>

          <licensesOutputDirectory>${project.basedir}/third-party-licenses</licensesOutputDirectory>
          <licensesOutputFile>${project.basedir}/third-party-licenses/licenses.xml</licensesOutputFile>
          <forceDownload>false</forceDownload>

          <failOnMissingHeader>true</failOnMissingHeader>
          <failOnNotUptodateHeader>true</failOnNotUptodateHeader>
          <canUpdateCopyright>true</canUpdateCopyright>
          <addJavaLicenseAfterPackage>false</addJavaLicenseAfterPackage>

          <includes>
            <include>**/*.java</include>
          </includes>
          <excludes>
            <exclude>**/generated/**</exclude>
          </excludes>
        </configuration>

        <dependencies>
          <dependency>
            <groupId>de.gematik</groupId>
            <artifactId>ospo-resources</artifactId>
            <version>${ospo-resources.version}</version>
          </dependency>
        </dependencies>

        <executions>
          <!-- Update der Source-Header -->
          <execution>
            <id>update-file-header</id>
            <goals>
              <goal>update-file-header</goal>
            </goals>
          </execution>

          <!-- Check der Source-Header -->
          <execution>
            <id>check-file-header</id>
            <goals>
              <goal>check-file-header</goal>
            </goals>
          </execution>

          <!-- Download der transitiven Lizenzen -->
          <execution>
            <id>download-licenses</id>
            <goals>
              <goal>download-licenses</goal>
            </goals>
            <phase>none</phase>
          </execution>
        </executions>
      </plugin>

    </plugins>

    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>${version.build.helper}</version>
          <executions>
            <execution>
              <id>remove-old-artifacts</id>
              <phase>package</phase>
              <goals>
                <goal>remove-project-artifact</goal>
              </goals>
              <configuration>
                <removeAll>true</removeAll><!-- remove all versions of built artifacts
									including all versions. Install phase will regenerate -->
                <failOnError>false</failOnError>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>buildnumber-maven-plugin</artifactId>
          <version>${version.buildnumber}</version>
          <executions>
            <execution>
              <phase>validate</phase>
              <goals>
                <goal>create</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <format>{0,date,yyyy-MM-dd HH:mm:ss}</format>
            <items>
              <item>timestamp</item>
            </items>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>${version.jar}</version>
          <configuration>
            <archive>
              <manifest>
                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
              </manifest>
              <manifestEntries>
                <Build-Version>
                  ${project.version}
                </Build-Version>
                <!--suppress UnresolvedMavenProperty -->
                <Build-Date>${buildNumber}</Build-Date>
              </manifestEntries>
            </archive>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>${version.maven-release}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-site-plugin</artifactId>
          <version>${version.site}</version>
          <configuration>
            <locales>de</locales>
            <inputEncoding>UTF-8</inputEncoding>
            <outputEncoding>UTF-8</outputEncoding>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>${version.maven-assembly-plugin}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>${version.maven-resources}</version>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <dependencies>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${version.slf4j-api}</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-reload4j</artifactId>
        <version>${version.slf4j-log4j}</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-core</artifactId>
        <version>${version.log4j2}</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-api</artifactId>
        <version>${version.log4j2}</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter</artifactId>
        <version>${version.junit-jupiter-api}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <scope>provided</scope>
        <version>${version.lombok}</version>
      </dependency>
      <!-- https://mvnrepository.com/artifact/org.assertj/assertj-core -->
      <dependency>
        <groupId>org.assertj</groupId>
        <artifactId>assertj-core</artifactId>
        <version>${assertj-core.version}</version>
        <scope>test</scope>
      </dependency>
  </dependencies>



  <dependencyManagement>
    <dependencies>
      <!--
      The following transitive dependencies have security issues in earlier versions and
      therefore their version have been manually fixed
       -->
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-compress</artifactId>
        <version>${commons-compress.version}</version>
      </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-text</artifactId>
            <version>${commons-text.version}</version>
        </dependency>
      <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>${guava.version}</version>
      </dependency>
      <dependency>
        <groupId>org.thymeleaf</groupId>
        <artifactId>thymeleaf</artifactId>
        <version>${thymeleaf.version}</version>
      </dependency>

      <!--
     The following transitive dependencies do not converge (see maven-enforcer-plugin) and are therefore fixed
     -->
      <dependency>
        <groupId>org.checkerframework</groupId>
        <artifactId>checker-qual</artifactId>
        <version>${checker-qual.version}</version>
      </dependency>
      <dependency>
        <groupId>commons-codec</groupId>
        <artifactId>commons-codec</artifactId>
        <version>${commons-codec.version}</version>
      </dependency>
      <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>${commons-io.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>${commons-lang3.version}</version>
      </dependency>
      <dependency>
        <groupId>com.google.errorprone</groupId>
        <artifactId>error_prone_annotations</artifactId>
        <version>${error_prone_annotations.version}</version>
      </dependency>
      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-annotations</artifactId>
        <version>${version.jackson}</version>
      </dependency>
      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-core</artifactId>
        <version>${version.jackson}</version>
      </dependency>
      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>${version.jackson}</version>
      </dependency>
      <dependency>
        <groupId>ca.uhn.hapi.fhir</groupId>
        <artifactId>hapi-fhir-base</artifactId>
        <version>${version.hapi-fhir-validation}</version>
      </dependency>
      <dependency>
        <groupId>ca.uhn.hapi.fhir</groupId>
        <artifactId>hapi-fhir-caching-caffeine</artifactId>
        <version>${version.hapi-fhir-validation}</version>
      </dependency>


      <!-- End of fixed versions -->



      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${version.slf4j-api}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-reload4j</artifactId>
        <version>${version.slf4j-log4j}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-core</artifactId>
        <version>${version.log4j2}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-api</artifactId>
        <version>${version.log4j2}</version>
      </dependency>
      <dependency>
        <groupId>ca.uhn.hapi.fhir</groupId>
        <artifactId>hapi-fhir-validation</artifactId>
        <version>${version.hapi-fhir-validation}</version>
        <exclusions>
          <exclusion>
            <groupId>ca.uhn.hapi.fhir</groupId>
            <artifactId>hapi-fhir-jpaserver-model</artifactId>
          </exclusion>
          <exclusion>
            <groupId>com.squareup.okhttp3</groupId>
            <artifactId>okhttp</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
          </exclusion>
          <exclusion>
            <artifactId>Saxon-HE</artifactId>
            <groupId>net.sf.saxon</groupId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>ca.uhn.hapi.fhir</groupId>
        <artifactId>hapi-fhir-structures-r4</artifactId>
        <version>${version.hapi-fhir-validation}</version>
        <exclusions>
          <exclusion>
            <groupId>com.squareup.okhttp3</groupId>
            <artifactId>okhttp</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>ca.uhn.hapi.fhir</groupId>
        <artifactId>hapi-fhir-validation-resources-r4</artifactId>
        <version>${version.hapi-fhir-validation}</version>
      </dependency>
      <dependency>
        <groupId>com.fasterxml.woodstox</groupId>
        <artifactId>woodstox-core</artifactId>
        <version>${version.woodstox}</version>
      </dependency>
      <dependency>
        <groupId>com.fasterxml.jackson.dataformat</groupId>
        <artifactId>jackson-dataformat-yaml</artifactId>
        <version>${version.jackson}</version>
      </dependency>
      <dependency>
        <groupId>info.picocli</groupId>
        <artifactId>picocli</artifactId>
        <version>${version.picocli}</version>
      </dependency>
      <dependency>
        <groupId>org.yaml</groupId>
        <artifactId>snakeyaml</artifactId>
        <version>${version.snakeyaml}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <profiles>
    <profile>
      <id>external</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>${version.maven-javadoc-plugin}</version>
            <configuration>
              <doclint>none</doclint>
            </configuration>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>${version.maven-gpg-plugin}</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>${central-publishing-maven-plugin.version}</version>
            <extensions>true</extensions>
            <configuration>
              <publishingServerId>central</publishingServerId>
              <autoPublish>true</autoPublish>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>modules-excluded-from-deployment</id>
      <!--
      According to https://github.com/sonatype/nexus-maven-plugins/tree/master/staging/maven-plugin
      and https://issues.sonatype.org/browse/NEXUS-9138
      skipNexusStagingDeployMojo may not be set to true in the last reactor module. Because we don't
      want to deploy our last module, nor a dummy module, we simply omit the relevant modules when
      a deploy is in progress.
      See https://stackoverflow.com/questions/25305850/how-to-disable-nexus-staging-maven-plugin-in-sub-modules
      -->
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <modules>
        <module>snapshot-generator</module>
        <module>cli</module>
      </modules>
    </profile>

    <profile>
      <id>performance-tests</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <modules>
        <module>valmodule-erp-perf-tests</module>
        <module>valmodule-erpta7-perf-tests</module>
      </modules>
    </profile>

  </profiles>
</project>
