<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>org.neo4j.driver</groupId>
  <artifactId>neo4j-java-driver-parent</artifactId>
  <version>5.18.0</version>

  <packaging>pom</packaging>
  <name>Neo4j Java Driver Project</name>
  <description>A project for building a Java driver for the Neo4j Bolt protocol.</description>
  <url>https://github.com/neo4j/neo4j-java-driver</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <maven.compiler.release>17</maven.compiler.release>
    <maven.compiler.xlint.extras/>
    <maven.build.timestamp.format>'v'yyyyMMdd-HHmm</maven.build.timestamp.format>

    <bundle.name>${project.groupId}.${project.artifactId}</bundle.name>

    <rootDir>${project.basedir}</rootDir>
    <parallelizable.it.forkCount>2</parallelizable.it.forkCount>
    <!-- All tests tagged are to be executed in parallel -->
    <parallelizable.it.tags>parallelizableIT</parallelizable.it.tags>
    <surefire.and.failsafe.version>3.1.2</surefire.and.failsafe.version>
    <surefire.jpms.args/>
    <failsafe.parallelizable.jpms.args/>
    <!-- Skip deployment by default for everything in this project. -->
    <maven.deploy.skip>true</maven.deploy.skip>

    <!-- Versions -->
    <reactive-streams.version>1.0.4</reactive-streams.version>
    <!-- Please note that when updating this dependency -->
    <!-- (i.e. due to a security vulnerability or bug) that the -->
    <!-- corresponding server dependency also needs updating.-->
    <netty-bom.version>4.1.107.Final</netty-bom.version>
    <!-- Please note that when updating this dependency -->
    <!-- (i.e. due to a security vulnerability or bug) that the -->
    <!-- corresponding server dependency also needs updating.-->
    <reactor-bom.version>2023.0.3</reactor-bom.version>
    <slf4j-api.version>1.7.36</slf4j-api.version>
    <hamcrest.version>2.2</hamcrest.version>
    <mockito-core.version>5.8.0</mockito-core.version>
    <junit.version>5.10.2</junit.version>
    <!-- supply a newer version than the one supplied by the reactive-streams 1.0.4 -->
    <testng.version>7.9.0</testng.version>
    <jarchivelib.version>1.2.0</jarchivelib.version>
    <!-- supply a newer version than the one supplied by the jarchivelib 1.2.0 -->
    <commons-compress.version>1.26.0</commons-compress.version>
    <!-- an optional dependency of commons-compress used by TarArchiveOutputStream -->
    <commons-codec.version>1.16.1</commons-codec.version>
    <bouncycastle-jdk18on.version>1.77</bouncycastle-jdk18on.version>
    <logback-classic.version>1.2.13</logback-classic.version>
    <jackson.version>2.16.1</jackson.version>
    <lombok.version>1.18.30</lombok.version>
    <svm.version>23.1.2</svm.version>
    <micrometer.version>1.12.3</micrometer.version>
    <blockhound.version>1.0.8.RELEASE</blockhound.version>
    <testcontainers.version>1.19.6</testcontainers.version>
    <build-resources.version>5.17.0</build-resources.version>
    <!-- To be overwritten by child projects -->
    <moduleName/>
  </properties>

  <modules>
    <module>driver</module>
    <module>bundle</module>
    <module>examples</module>
    <module>testkit-backend</module>
    <module>testkit-tests</module>
    <module>benchkit-backend</module>
  </modules>

  <licenses>
    <license>
      <name>Apache License, Version 2</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <id>neo4j</id>
      <name>The Neo4j Team</name>
      <url>http://www.neo4j.com/</url>
      <organization>Neo4j Sweden AB</organization>
      <organizationUrl>http://www.neo4j.com/</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git://github.com/neo4j/neo4j-java-driver.git</connection>
    <developerConnection>scm:git:git@github.com:neo4j/neo4j-java-driver.git</developerConnection>
    <url>https://github.com/neo4j/neo4j-java-driver</url>
  </scm>

  <dependencyManagement>
    <dependencies>
      <!-- Compile dependencies -->
      <dependency>
        <groupId>org.reactivestreams</groupId>
        <artifactId>reactive-streams</artifactId>
        <version>${reactive-streams.version}</version>
      </dependency>
      <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-bom</artifactId>
        <version>${netty-bom.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>io.projectreactor</groupId>
        <artifactId>reactor-bom</artifactId>
        <version>${reactor-bom.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <!-- Optional dependencies -->
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j-api.version}</version>
      </dependency>
      <dependency>
        <groupId>io.micrometer</groupId>
        <artifactId>micrometer-core</artifactId>
        <version>${micrometer.version}</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>io.projectreactor.tools</groupId>
        <artifactId>blockhound</artifactId>
        <version>${blockhound.version}</version>
        <scope>provided</scope>
      </dependency>

      <!-- Test dependencies -->
      <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest</artifactId>
        <version>${hamcrest.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.junit.jupiter</groupId>
        <artifactId>junit-jupiter</artifactId>
        <version>${junit.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.testng</groupId>
        <artifactId>testng</artifactId>
        <version>${testng.version}</version>
        <scope>test</scope>
        <exclusions>
          <exclusion>
            <groupId>org.webjars</groupId>
            <artifactId>jquery</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.rauschig</groupId>
        <artifactId>jarchivelib</artifactId>
        <version>${jarchivelib.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-compress</artifactId>
        <version>${commons-compress.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>commons-codec</groupId>
        <artifactId>commons-codec</artifactId>
        <version>${commons-codec.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.bouncycastle</groupId>
        <artifactId>bcprov-jdk18on</artifactId>
        <version>${bouncycastle-jdk18on.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.bouncycastle</groupId>
        <artifactId>bcpkix-jdk18on</artifactId>
        <version>${bouncycastle-jdk18on.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>${logback-classic.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.reactivestreams</groupId>
        <artifactId>reactive-streams-tck</artifactId>
        <version>${reactive-streams.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.testcontainers</groupId>
        <artifactId>testcontainers-bom</artifactId>
        <version>${testcontainers.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <!-- Testkit Backend Dependencies -->
      <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.version}</version>
      </dependency>
      <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <version>${lombok.version}</version>
        <scope>provided</scope>
      </dependency>

      <!-- Graal VM -->
      <dependency>
        <groupId>org.graalvm.nativeimage</groupId>
        <artifactId>svm</artifactId>
        <version>${svm.version}</version>
        <!-- Provided scope as it is only needed for compiling the SVM substitution classes -->
        <scope>provided</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <profiles>
    <!-- Disable parallel execution of integration tests with "-DsequentialITs" -->
    <profile>
      <id>sequentialIntegrationTests</id>
      <activation>
        <property>
          <name>sequentialITs</name>
        </property>
      </activation>
      <properties>
        <parallelizable.it.forkCount>1</parallelizable.it.forkCount>
      </properties>
    </profile>

    <profile>
      <id>skip-docker-tests</id>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-failsafe-plugin</artifactId>
              <configuration>
                <systemPropertyVariables>
                  <skipDockerTests>true</skipDockerTests>
                </systemPropertyVariables>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
  </profiles>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.10.1</version>
          <configuration>
            <showDeprecation>true</showDeprecation>
            <showWarnings>true</showWarnings>
            <compilerArgs>
              <arg>-Xlint:all${maven.compiler.xlint.extras}</arg>
              <arg>-Werror</arg>
            </compilerArgs>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${surefire.and.failsafe.version}</version>
          <configuration>
            <argLine>${surefire.jpms.args}</argLine>
            <trimStackTrace>false</trimStackTrace>
            <classpathDependencyExcludes>
              <classpathDependencyExclude>org.graalvm.nativeimage:svm</classpathDependencyExclude>
            </classpathDependencyExcludes>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>${surefire.and.failsafe.version}</version>
          <configuration>
            <classpathDependencyExcludes>
              <classpathDependencyExclude>org.graalvm.nativeimage:svm</classpathDependencyExclude>
            </classpathDependencyExcludes>
          </configuration>
          <executions>
            <!-- execution 1: execute all ITs that support parallel execution (regular single-instance tests)  -->
            <execution>
              <id>parallelizable-integration-tests</id>
              <goals>
                <goal>integration-test</goal>
                <goal>verify</goal>
              </goals>
              <configuration>
                <argLine>-Dfile.encoding=${project.build.sourceEncoding} -DtestJvmId=${surefire.forkNumber} ${failsafe.parallelizable.jpms.args}</argLine>
                <trimStackTrace>false</trimStackTrace>
                <forkCount>${parallelizable.it.forkCount}</forkCount>
                <reuseForks>true</reuseForks>
                <groups>${parallelizable.it.tags}</groups>
              </configuration>
            </execution>

            <!-- execution 2: execute all ITs that do not support parallel execution (stub server tests, causal cluster tests)  -->
            <execution>
              <id>sequential-integration-tests</id>
              <goals>
                <goal>integration-test</goal>
                <goal>verify</goal>
              </goals>
              <configuration>
                <argLine>-Dfile.encoding=${project.build.sourceEncoding}</argLine>
                <trimStackTrace>false</trimStackTrace>
                <forkCount>1</forkCount>
                <reuseForks>true</reuseForks>
                <excludedGroups>${parallelizable.it.tags}</excludedGroups>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>clirr-maven-plugin</artifactId>
          <version>2.8</version>
          <executions>
            <execution>
              <phase>compile</phase>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>2.8.2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>3.0.1</version>
          <executions>
            <execution>
              <id>attach-sources</id>
              <goals>
                <goal>jar</goal>
              </goals>
              <configuration>
                <archive>
                  <manifestEntries>
                    <Bundle-Name>${project.name} (Source)</Bundle-Name>
                    <Bundle-SymbolicName>${bundle.name}.source</Bundle-SymbolicName>
                    <Bundle-Version>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.${build.timestamp}</Bundle-Version>
                    <Eclipse-SourceBundle>${bundle.name};version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.${build.timestamp}";roots:="."</Eclipse-SourceBundle>
                  </manifestEntries>
                </archive>
              </configuration>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.1.0</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.felix</groupId>
          <artifactId>maven-bundle-plugin</artifactId>
          <version>5.1.8</version>
          <executions>
            <execution>
              <id>bundle-manifest</id>
              <phase>process-classes</phase>
              <goals>
                <goal>manifest</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <instructions>
              <Bundle-SymbolicName>${bundle.name}</Bundle-SymbolicName>
              <Bundle-Version>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.${build.timestamp}</Bundle-Version>
              <_snapshot>${maven.build.timestamp}</_snapshot>
              <_versionpolicy>[$(version;==;$(@)),$(version;+;$(@)))</_versionpolicy>
              <_removeheaders>Bnd-*,Private-Package</_removeheaders>
              <_nouses>true</_nouses>
              <_include>-osgi.bnd</_include>
            </instructions>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-shade-plugin</artifactId>
          <version>3.3.0</version>
        </plugin>
        <plugin>
          <groupId>com.diffplug.spotless</groupId>
          <artifactId>spotless-maven-plugin</artifactId>
          <version>2.23.0</version>
          <executions>
            <execution>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <java>
              <palantirJavaFormat/>
            </java>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>3.0.0</version>
          <dependencies>
            <dependency>
              <groupId>de.skuzzle.enforcer</groupId>
              <artifactId>restrict-imports-enforcer-rule</artifactId>
              <version>2.0.0</version>
            </dependency>
          </dependencies>
          <executions>
            <execution>
              <goals>
                <goal>enforce</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <rules>
              <RestrictImports>
                <reason>Star imports are not allowed, please configure your editor to substitute them with fully qualified imports.</reason>
                <bannedImport>**.'*'</bannedImport>
              </RestrictImports>
            </rules>
            <fail>true</fail>
          </configuration>
        </plugin>
        <plugin>
          <groupId>com.mycila</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>3.0</version>
          <configuration>
            <strictCheck>true</strictCheck>
            <header>license/neo4j_apache_v2/header.txt</header>
            <mapping>
              <java>SLASHSTAR_STYLE</java>
            </mapping>
            <includes>
              <include>**/*.java</include>
            </includes>
          </configuration>
          <executions>
            <execution>
              <!-- always check license headers -->
              <id>check-licenses</id>
              <phase>initialize</phase>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
            <!-- also available: `mvn license:[cmd]` where cmd could be one of `check`, `format`, or `delete`-->
          </executions>
          <dependencies>
            <dependency>
              <groupId>org.neo4j.build</groupId>
              <artifactId>build-resources</artifactId>
              <version>${build-resources.version}</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>org.neo4j.build.plugins</groupId>
          <artifactId>licensing-maven-plugin</artifactId>
          <version>1.7.11</version>
          <configuration>
            <failIfDisliked>true</failIfDisliked>
            <failIfMissing>true</failIfMissing>
            <plainTextReport>true</plainTextReport>
            <prependText>licensing/notice-apache2-prefix.txt</prependText>
            <excludedGroups>
              ^((org.neo4j.driver){1})$
            </excludedGroups>
            <includedScopes>compile</includedScopes>
          </configuration>
          <executions>
            <execution>
              <id>list-all-licenses</id>
              <phase>compile</phase>
              <goals>
                <goal>check</goal>
              </goals>
              <configuration>
                <licensingRequirementFiles>
                  <licensingRequirementFile>licensing/licensing-requirements-base.xml</licensingRequirementFile>
                </licensingRequirementFiles>
                <thirdPartyLicensingFilename>${project.artifactId}-${project.version}-NOTICE.txt
                </thirdPartyLicensingFilename>
                <checkExistingNoticeFile>${project.build.directory}/../NOTICE.txt</checkExistingNoticeFile>
                <listPrependText>licensing/list-prefix.txt</listPrependText>
                <listReport>${project.artifactId}-${project.version}-LICENSES.txt</listReport>
                <checkExistingLicensesFile>${project.build.directory}/../LICENSES.txt</checkExistingLicensesFile>
              </configuration>
            </execution>
          </executions>
          <dependencies>
            <dependency>
              <groupId>org.neo4j.build</groupId>
              <artifactId>build-resources</artifactId>
              <version>${build-resources.version}</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>2.7</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>3.4.0</version>
          <configuration>
            <charset>UTF-8</charset>
            <docencoding>UTF-8</docencoding>
            <encoding>UTF-8</encoding>
            <top><![CDATA[
            <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.9.0/styles/default.min.css">
            <script src="http://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.9.0/highlight.min.js"></script>
            <script>hljs.initHighlightingOnLoad();</script>
          ]]></top>
            <bottom>
              <![CDATA[
                    <script>
                    if (typeof useModuleDirectories !== 'undefined') {
                      useModuleDirectories = false;
                    }
                    </script>
                ]]>
            </bottom>
            <additionalOptions>
              <!-- Required for Java 8u121 or later. See https://github.com/neo4j/neo4j-java-driver/pull/318  -->
              <option>--allow-script-in-comments</option>
              <option>-Xdoclint/package:-org.neo4j.driver.internal,-org.neo4j.driver.internal.*</option>
            </additionalOptions>
            <sourceFileIncludes>
              <sourceFileInclude>org/neo4j/driver/**/*.java</sourceFileInclude>
            </sourceFileIncludes>
            <excludePackageNames>org.neo4j.driver.internal</excludePackageNames>
            <overview>${rootDir}/build/javadoc/overview.html</overview>
          </configuration>
          <executions>
            <execution>
              <id>attach-javadocs</id>
              <goals>
                <goal>jar</goal>
              </goals>
              <configuration>
                <failOnWarnings>true</failOnWarnings>
              </configuration>
            </execution>
            <execution>
              <id>aggregate</id>
              <goals>
                <goal>aggregate</goal>
              </goals>
              <phase>site</phase>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.moditect</groupId>
          <artifactId>moditect-maven-plugin</artifactId>
          <version>1.0.0.RC2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-antrun-plugin</artifactId>
          <version>3.1.0</version>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>versions-maven-plugin</artifactId>
          <version>2.15.0</version>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.neo4j.build.plugins</groupId>
        <artifactId>licensing-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.0.1</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <!-- Explicit deployment override for this artifact only. -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <inherited>false</inherited>
        <configuration>
          <skip>false</skip>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
      </plugin>
    </plugins>
  </build>
</project>
