<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</groupId>
  <artifactId>parent</artifactId>
  <version>3.4.9</version>
  <packaging>pom</packaging>
  <name>Neo4j</name>
  <description>Neo4j Graph Database</description>
  <inceptionYear>2002</inceptionYear>
  <url>http://neo4j.com/</url>

  <organization>
    <name>The Neo4j Graph Database Project</name>
    <url>https://neo4j.com/</url>
  </organization>

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

  <licenses>
    <license>
      <name>GNU Affero General Public License, Version 3 with the Commons Clause</name>
      <url>http://www.gnu.org/licenses/agpl-3.0-standalone.html</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <id>neo4j</id>
      <name>The Neo4j Team</name>
      <url>https://neo4j.com/</url>
      <organization>Neo4j Inc.</organization>
      <organizationUrl>https://neo4j.com/</organizationUrl>
    </developer>
  </developers>

  <mailingLists>
    <mailingList>
      <name>Neo4j Community Discussions</name>
      <subscribe>https://groups.google.com/forum/#!forum/neo4j</subscribe>
    </mailingList>
  </mailingLists>

  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/neo4j/neo4j/issues</url>
  </issueManagement>
  
  <distributionManagement>
    <repository>
      <id>sonatype-nexus-staging</id>
      <name>Nexus Release Repository</name>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <licensing.prepend.text>licensing/notice-agpl-prefix.txt</licensing.prepend.text>
    <lucene.version>5.5.5</lucene.version>
    <bouncycastle.version>1.60</bouncycastle.version>
    <generate-config-docs-phase>prepare-package</generate-config-docs-phase>
    <java.exports/>
    <test.runner.jvm/>
    <test.runner.jvm.settings.additional/>
    <test.runner.jvm.settings>-Xmx2G -XX:+UseG1GC -XX:-OmitStackTraceInFastThrow -XX:+HeapDumpOnOutOfMemoryError
      -XX:HeapDumpPath=target/test-data -Dorg.neo4j.unsafe.impl.internal.dragons.UnsafeUtil.DIRTY_MEMORY=true
      -Dorg.neo4j.unsafe.impl.internal.dragons.UnsafeUtil.CHECK_NATIVE_ACCESS=true
      -Dorg.neo4j.io.pagecache.impl.muninn.usePreciseCursorErrorStackTraces=true
      -Dorg.neo4j.kernel.impl.api.KernelStatement.trackStatements=true
      -Dorg.org.neo4j.kernel.impl.newapi.DefaultCursors.trackCursors=true
      -XX:+UnlockExperimentalVMOptions -XX:+TrustFinalNonStaticFields ${java.exports} ${test.runner.jvm.settings.additional}
    </test.runner.jvm.settings>
    <jetty.version>9.4.11.v20180605</jetty.version>
    <findbugs.version>3.0.1</findbugs.version>
    <git.commit>unknown-commit</git.commit>
    <forkCounts>0</forkCounts>
    <maven.build.timestamp.format>yyMMddHHmmssSSS</maven.build.timestamp.format>

    <license-text.header>headers/AGPL-3-header.txt</license-text.header>

    <scala-maven-plugin.version>3.3.2</scala-maven-plugin.version>
    <scala.version>2.11.12</scala.version>
    <scala.binary.version>2.11</scala.binary.version>
    <asm.version>6.2</asm.version>
    <metrics.version>4.0.2</metrics.version>
    <scala.target.vm>1.8</scala.target.vm>
    <scala.java.additional.args/>
    <jersey.version>1.19.3</jersey.version>
    <currentYear>2018</currentYear>
    <cypher.compatibility.23>2.3.12</cypher.compatibility.23>
    <cypher.compatibility.31>3.1.9</cypher.compatibility.31>
    <cypher.compatibility.33>3.3.7</cypher.compatibility.33>
    <caffeine.version>2.6.2</caffeine.version>
  </properties>

  <modules>
    <module>build-resources</module>
    <module>community</module>
    <module>enterprise</module>
    <module>integrationtests</module>
    <module>stresstests</module>
    <module>tools</module>
    <module>packaging</module>
  </modules>

  <build>
    <!-- Define project structure -->
    <resources>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
      <resource>
        <directory>${basedir}/src/main/resources/META-INF/</directory>
        <targetPath>META-INF</targetPath>
      </resource>
      <resource>
        <directory>${basedir}</directory>
        <targetPath>META-INF</targetPath>
        <includes>
          <include>COPYRIGHT.txt</include>
          <include>NOTICE.txt</include>
          <include>LICENSE.txt</include>
          <include>LICENSES.txt</include>
          <include>README*</include>
          <include>CHANGES.txt</include>
        </includes>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
      </testResource>
      <testResource>
        <directory>${basedir}</directory>
        <targetPath>META-INF</targetPath>
        <includes>
          <include>COPYRIGHT.txt</include>
          <include>NOTICE.txt</include>
          <include>LICENSE.txt</include>
          <include>LICENSES.txt</include>
          <include>README*</include>
          <include>CHANGES.txt</include>
        </includes>
      </testResource>
    </testResources>

    <!-- Plugin definitions -->
    <pluginManagement>
      <plugins>

        <!-- Here we define our public API, it should be kept in sync with revapi settings below -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>3.0.0</version>
          <executions>
            <execution>
              <id>generate-javadocs</id>
              <goals>
                <goal>javadoc-no-fork</goal>
              </goals>
              <phase>prepare-package</phase>
            </execution>
          </executions>
          <configuration>
            <header>Neo4j</header>
            <doctitle>Neo4j ${project.version} API</doctitle>
            <windowtitle>Neo4j ${project.version} API</windowtitle>
            <show>public</show>

            <detectLinks>false</detectLinks>
            <detectOfflineLinks>false</detectOfflineLinks>
            <quiet>true</quiet>
            <reportOutputDirectory>${project.build.directory}/apidocs</reportOutputDirectory>

            <!-- Defines grouping for overview -->
            <groups>
              <group>
                <title>Graph database</title>
                <packages>org.neo4j.graphdb:org.neo4j.graphdb.*
                </packages>
              </group>
              <group>
                <title>Query language</title>
                <packages>org.neo4j.cypher.javacompat:org.neo4j.cypher.javacompat.*:org.neo4j.cypher.export</packages>
              </group>
              <group>
                <title>Graph algorithms</title>
                <packages>org.neo4j.graphalgo:org.neo4j.graphalgo.*</packages>
              </group>
              <group>
                <title>Management</title>
                <packages>org.neo4j.jmx:org.neo4j.jmx.*</packages>
              </group>
              <group>
                <title>Management (Enterprise edition)</title>
                <packages>org.neo4j.management:org.neo4j.management.*</packages>
              </group>
              <group>
                <title>Logging</title>
                <packages>org.neo4j.logging:org.neo4j.logging.*</packages>
              </group>
              <group>
                <title>Backup (Enterprise edition)</title>
                <packages>org.neo4j.backup</packages>
              </group>
              <group>
                <title>Import</title>
                <packages>org.neo4j.unsafe.batchinsert</packages>
              </group>
              <group>
                <title>Procedures</title>
                <packages>org.neo4j.procedure</packages>
              </group>
              <group>
                <title>Server Plugin API</title>
                <packages>org.neo4j.server:org.neo4j.server.*</packages>
              </group>
              <group>
                <title>Helpers</title>
                <packages>org.neo4j.helpers:org.neo4j.helpers.*</packages>
              </group>
              <group>
                <title>Explicit Indexes</title>
                <packages>org.neo4j.index:org.neo4j.index.*</packages>
              </group>
            </groups>

            <!-- Include the following packages... (yes, has to be one line) -->
            <subpackages>org.neo4j.backup:org.neo4j.graphalgo:org.neo4j.cypher.export:org.neo4j.cypher.javacompat:org.neo4j.graphdb:org.neo4j.helpers:org.neo4j.helpers.collection:org.neo4j.index:org.neo4j.jmx:org.neo4j.management:org.neo4j.server.helpers:org.neo4j.server.plugins:org.neo4j.server.rest.repr:org.neo4j.server.rest.web:org.neo4j.unsafe.batchinsert:org.neo4j.logging:org.neo4j.procedure</subpackages>
            <!-- ...unless the package contains -->
            <excludePackageNames>*.impl.*:*.internal.*:org.neo4j.helpers.progress:org.neo4j.logging.async:org.neo4j.server.rest.repr.formats:org.neo4j.server.rest.repr.util</excludePackageNames>
          </configuration>
        </plugin>

        <!-- Define what packages to treat as public API, it should be kept in sync with javadoc settings above -->
        <plugin>
          <groupId>org.revapi</groupId>
          <artifactId>revapi-maven-plugin</artifactId>
          <version>0.10.0</version>
          <configuration>
            <versionFormat>^\d+\.\d+\.\d+$</versionFormat>
            <analysisConfiguration>
              <revapi.java>
                <reportUsesFor>all-differences</reportUsesFor>
                <missing-classes>
                  <behavior>report</behavior>
                  <ignoreMissingAnnotations>false</ignoreMissingAnnotations>
                </missing-classes>
                <filter>
                  <classes>
                    <regex>true</regex>
                    <include>
                      <item>org\.neo4j\.helpers\.collection\.BoundedIterable</item>
                    </include>
                    <exclude>
                      <item>org\.neo4j\.graphdb\.Path</item>
                      <!--TODO remove this again once released-->
                      <item>org\.neo4j\.server\.rest\.repr\.ListRepresentation</item>
                      <item>org\.neo4j\.server\.rest\.repr\.RepresentationType</item>
                      <item>org\.neo4j\.server\.rest\.repr\.ValueRepresentation</item>
                      <item>org\.neo4j\.server\.helpers\.PropertyTypeDispatcher</item>
                    </exclude>
                  </classes>
                  <packages>
                    <regex>true</regex>
                    <include>
                      <item>org\.neo4j\.graphalgo(\\..+)?</item>
                      <item>org\.neo4j\.cypher\.export(\\..+)?</item>
                      <item>org\.neo4j\.cypher\.javacompat(\\..+)?</item>
                      <item>org\.neo4j\.graphdb(\\..+)?</item>
                      <item>org\.neo4j\.helpers(\\..+)?</item>
                      <item>org\.neo4j\.index(\\..+)?</item>
                      <item>org\.neo4j\.jmx(\\..+)?</item>
                      <item>org\.neo4j\.management(\\..+)?</item>
                      <item>org\.neo4j\.server\.helpers(\\..+)?</item>
                      <item>org\.neo4j\.server\.plugins(\\..+)?</item>
                      <item>org\.neo4j\.server\.rest\.repr(\\..+)?</item>
                      <item>org\.neo4j\.server\.rest\.web(\\..+)?</item>
                      <item>org\.neo4j\.unsafe\.batchinsert(\\..+)?</item>
                      <item>org\.neo4j\.logging(\\..+)?</item>
                      <item>org\.neo4j\.procedure(\\..+)?</item>
                    </include>
                    <exclude>
                      <item>.*\.impl\..*</item>
                      <item>.*\.internal\..*</item>
                      <item>org\.neo4j\.helpers\.progress</item>
                      <item>org\.neo4j\.logging\.async</item>
                      <item>org\.neo4j\.server\.rest\.repr\.formats</item>
                      <item>org\.neo4j\.server\.rest\.repr\.util</item>
                    </exclude>
                  </packages>
                </filter>
              </revapi.java>
              <revapi.ignore>
                <item>
                  <!-- Ignore for now since some are already published, should be removed in 4.0 -->
                  <code>java.class.nonPublicPartOfAPI</code>
                </item>
              </revapi.ignore>
              <revapi.semver.ignore>
                <enabled>true</enabled>
                <versionIncreaseAllows>
                  <major>breaking</major>
                  <minor>nonBreaking</minor>
                  <patch>equivalent</patch>
                </versionIncreaseAllows>
                <passThroughDifferences>
                  <!-- Let revapi.ignore handle this -->
                  <item>java.class.nonPublicPartOfAPI</item>
                </passThroughDifferences>
              </revapi.semver.ignore>
            </analysisConfiguration>
          </configuration>
          <dependencies>
            <dependency>
              <groupId>org.revapi</groupId>
              <artifactId>revapi-java</artifactId>
              <version>0.15.1</version>
            </dependency>
            <dependency>
              <groupId>org.revapi</groupId>
              <artifactId>revapi-basic-features</artifactId>
              <version>0.7.0</version>
            </dependency>
          </dependencies>
          <executions>
            <execution>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <!-- Testing setup -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.21.0</version>
          <configuration>
            <forkCount>${forkCounts}</forkCount>
            <trimStackTrace>false</trimStackTrace>
            <reuseForks>true</reuseForks>
            <argLine>${test.runner.jvm.settings}</argLine>
            <runOrder>random</runOrder>
            <systemPropertyVariables>
              <dbms.pagecache.memory.default.override>8m</dbms.pagecache.memory.default.override>
              <java.io.tmpdir>${project.build.directory}</java.io.tmpdir>
            </systemPropertyVariables>
            <jvm>${test.runner.jvm}</jvm>
            <excludes>
              <exclude>**/*$*.class</exclude>
              <exclude>**/*IntegrationTest.class</exclude>
            </excludes>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <version>2.21.0</version>
          <configuration>
            <argLine>${test.runner.jvm.settings}</argLine>
            <forkCount>${forkCounts}</forkCount>
            <trimStackTrace>false</trimStackTrace>
            <reuseForks>true</reuseForks>
            <runOrder>random</runOrder>
            <includes>
              <include>**/IT*.class</include>
              <include>**/*IT.class</include>
              <include>**/*ITCase.class</include>
              <include>**/*IntegrationTest.class</include>
            </includes>
            <systemPropertyVariables>
              <dbms.pagecache.memory.default.override>8m</dbms.pagecache.memory.default.override>
              <port.authority.directory>${user.dir}/target/port-authority-${maven.build.timestamp}</port.authority.directory>
              <java.io.tmpdir>${project.build.directory}</java.io.tmpdir>
            </systemPropertyVariables>
            <jvm>${test.runner.jvm}</jvm>
          </configuration>
          <executions>
            <execution>
              <id>integration-test</id>
              <goals>
                <goal>integration-test</goal>
              </goals>
            </execution>
            <execution>
              <id>verify</id>
              <goals>
                <goal>verify</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <!-- Jar file packaging settings -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.0.2</version>
          <executions>
            <!-- Augment default jar with url -->
            <execution>
              <id>default-jar</id>
              <configuration>
                <archive>
                  <manifest>
                    <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                  </manifest>
                  <manifestEntries>
                    <Url>${project.organization.url}</Url>
                    <Automatic-Module-Name>${moduleName}</Automatic-Module-Name>
                  </manifestEntries>
                </archive>
              </configuration>
            </execution>
            <!-- Create test jar -->
            <execution>
              <id>create-test-jar</id>
              <goals>
                <goal>test-jar</goal>
              </goals>
            </execution>
            <!-- Create javadoc jar, will be empty if javadoc generation is skipped -->
            <execution>
              <id>create-javadoc-jar</id>
              <phase>package</phase>
              <goals>
                <goal>jar</goal>
              </goals>
              <configuration>
                <classifier>javadoc</classifier>
                <classesDirectory>${project.build.directory}/apidocs/</classesDirectory>
                <includes>
                  <include>**/**</include>
                </includes>
                <excludes>
                  <exclude>javadoc.sh</exclude>
                  <exclude>javadoc.bat</exclude>
                  <exclude>options</exclude>
                  <exclude>packages</exclude>
                  <exclude>argfile</exclude>
                  <exclude>files</exclude>
                </excludes>
              </configuration>
            </execution>
          </executions>
        </plugin>

        <!-- Licensing settings -->
        <plugin>
          <groupId>org.neo4j.build.plugins</groupId>
          <artifactId>licensing-maven-plugin</artifactId>
          <version>1.7.6</version>
          <configuration>
            <failIfDisliked>true</failIfDisliked>
            <failIfMissing>true</failIfMissing>
            <plainTextReport>true</plainTextReport>
            <prependText>${licensing.prepend.text}</prependText>
            <excludedGroups>
              ^((org.neo4j){1}|(org.neo4j.app){1}|(org.neo4j.server.plugin){1}|(org.neo4j.assembly){1}|(org.neo4j.bolt){1}|(org.neo4j.build){1}|(org.neo4j.test){1})$
            </excludedGroups>
            <excludedArtifacts>^((neo4j-browser))$</excludedArtifacts>
            <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>${project.version}</version>
            </dependency>
          </dependencies>
        </plugin>
        <plugin>
          <groupId>com.mycila</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>3.0</version>
          <executions>
            <execution>
              <id>check-licenses</id>
              <!-- fail as early as possible -->
              <phase>initialize</phase>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <strictCheck>true</strictCheck>
            <header>${license-text.header}</header>
            <includes>
              <include>src/**/*.java</include>
              <include>src/**/*.js</include>
              <include>src/**/*.scala</include>
              <include>src/**/*.xml</include>
              <include>src/**/*.feature</include>
              <include>src/**/*.g4</include>
            </includes>
            <excludes>
              <exclude>**/cypher-shell/*</exclude>
            </excludes>
            <mapping>
              <java>SLASHSTAR_STYLE</java>
              <scala>SLASHSTAR_STYLE</scala>
              <feature>SCRIPT_STYLE</feature>
              <g4>SLASHSTAR_STYLE</g4>
            </mapping>
            <properties>
              <currentYear>${currentYear}</currentYear>
            </properties>
          </configuration>
          <dependencies>
            <dependency>
              <groupId>org.neo4j.build</groupId>
              <artifactId>build-resources</artifactId>
              <version>${project.version}</version>
            </dependency>
          </dependencies>
        </plugin>

        <!-- Default scala compile settings -->
        <plugin>
          <groupId>net.alchim31.maven</groupId>
          <artifactId>scala-maven-plugin</artifactId>
          <version>${scala-maven-plugin.version}</version>

          <configuration>
            <scalaVersion>${scala.version}</scalaVersion>
            <scalaCompatVersion>${scala.binary.version}</scalaCompatVersion>
            <args>
              <arg>-Xmax-classfile-name</arg>
              <arg>100</arg>
              <arg>-Xlint</arg>
              <arg>-target:jvm-${scala.target.vm}</arg>
              <arg>${scala.java.additional.args}</arg>
            </args>
            <jvmArgs>
              <jvmArg>-Xms64m</jvmArg>
              <jvmArg>-Xmx1024m</jvmArg>
            </jvmArgs>
          </configuration>

          <!-- This is needed to mix scala and java code in the same module -->
          <executions>
            <execution>
              <id>scala-compile</id>
              <phase>process-resources</phase>
              <goals>
                <goal>add-source</goal>
                <goal>compile</goal>
              </goals>
            </execution>
            <execution>
              <id>scala-test-compile</id>
              <phase>process-test-resources</phase>
              <goals>
                <goal>testCompile</goal>
              </goals>
            </execution>
          </executions>
        </plugin>

        <!-- Enforce naming if packages -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>3.0.0-M1</version>
          <configuration>
            <rules>
              <evaluateBeanshell>
                <message>Maven module has to be in a "groupId" beginning with "org.neo4j"</message>
		<condition>{String s = "${project.groupId}"; s.startsWith("org.neo4j");}</condition>
              </evaluateBeanshell>
              <requireFilesDontExist>
                <message>You are not allowed to have classes in "com" package</message>
                <files>
                  <file>${project.build.sourceDirectory}/com</file>
                  <file>${project.build.testSourceDirectory}/com</file>
                </files>
              </requireFilesDontExist>
            </rules>
            <fail>true</fail>
          </configuration>
        </plugin>

        <!-- Plugin version management -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.7.0</version>
          <configuration>
            <showDeprecation>true</showDeprecation>
            <showWarnings>true</showWarnings>
            <compilerArgument>${java.exports}</compilerArgument>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-antrun-plugin</artifactId>
          <version>1.8</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-dependency-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>3.0.1</version>
        </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-install-plugin</artifactId>
          <version>2.5.2</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>2.5.3</version>
        </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-shade-plugin</artifactId>
          <version>3.1.0</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-assembly-plugin</artifactId>
          <version>3.1.0</version>
          <configuration>
            <tarLongFileMode>gnu</tarLongFileMode>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>exec-maven-plugin</artifactId>
          <version>1.4.0</version>
        </plugin>
        <plugin>
          <groupId>org.owasp</groupId>
          <artifactId>dependency-check-maven</artifactId>
          <version>3.1.2</version>
          <dependencies>
            <!-- https://mvnrepository.com/artifact/org.owasp/dependency-check-maven -->
            <dependency>
              <groupId>org.owasp</groupId>
              <artifactId>dependency-check-maven</artifactId>
              <version>3.1.0</version>
            </dependency>
          </dependencies>
          <executions>
            <execution>
              <goals>
                <goal>aggregate</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>

    <!-- Default plugins -->
    <plugins>

      <!-- Execute integration tests by default -->
      <plugin>
        <artifactId>maven-failsafe-plugin</artifactId>
      </plugin>

      <!-- Checkstyle is always validated -->
      <plugin>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>3.0.0</version>
        <configuration>
          <configLocation>checkstyle/checkstyle.xml</configLocation>
          <consoleOutput>true</consoleOutput>
          <logViolationsToConsole>true</logViolationsToConsole>
          <includeTestSourceDirectory>true</includeTestSourceDirectory>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>com.puppycrawl.tools</groupId>
            <artifactId>checkstyle</artifactId>
            <version>8.8</version>
          </dependency>
          <dependency>
            <groupId>org.neo4j.build</groupId>
            <artifactId>build-resources</artifactId>
            <version>${project.version}</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <id>validate</id>
            <phase>validate</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- Creates source jar if source exits -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-sources</id>
            <phase>verify</phase>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- Always enforce -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>enforce</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

    </plugins>
  </build>

  <profiles>
    <!-- Only generate NOTICE and LICENSES files for projects with src/ directory -->
    <profile>
      <id>has-sources</id>
      <activation>
        <activeByDefault>false</activeByDefault>
        <file>
          <exists>src</exists>
        </file>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.neo4j.build.plugins</groupId>
            <artifactId>licensing-maven-plugin</artifactId>
          </plugin>
          <plugin>
            <groupId>com.mycila</groupId>
            <artifactId>license-maven-plugin</artifactId>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- Disable parallel execution with "-DsequentialTests" -->
    <profile>
      <id>parallelTestExecution</id>
      <activation>
        <property>
          <name>!sequentialTests</name>
        </property>
      </activation>
      <properties>
        <forkCounts>1C</forkCounts>
      </properties>
    </profile>

    <profile>
      <id>testCoverage</id>
      <activation>
        <activeByDefault>false</activeByDefault>
        <property>
          <name>testCoverage</name>
        </property>
      </activation>
      <properties>
        <test.runner.jvm.settings.additional>@{argLine}</test.runner.jvm.settings.additional>
      </properties>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>0.7.9</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>merge</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>merge</goal>
                            </goals>
                            <configuration>
                                <destFile>${project.build.directory}/jacoco-aggregated.exec</destFile>
                                <fileSets>
                                    <fileSet implementation="org.apache.maven.shared.model.fileset.FileSet">
                                        <directory>${project.build.directory}</directory>
                                        <includes>
                                            <include>*.exec</include>
                                        </includes>
                                    </fileSet>
                                </fileSets>
                            </configuration>
                        </execution>
                        <execution>
                            <id>default-report</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>report</goal>
                            </goals>
                          <configuration>
                            <dataFile>${project.build.directory}/jacoco-aggregated.exec</dataFile>
                          </configuration>
                        </execution>
                        <execution>
                            <id>report-aggregate</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>report-aggregate</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </profile>

    <!--
     Git information extraction profiles.
     Activate by adding the required Git information to the environment, e.g. on *nix:

     export GIT_COMMIT
     GIT_COMMIT=$(git rev-parse HEAD)
    -->
    <profile>
      <id>attach-git-info-commit</id>
      <activation>
        <activeByDefault>false</activeByDefault>
        <property>
          <name>env.GIT_COMMIT</name>
        </property>
      </activation>
      <properties>
        <git.commit>${env.GIT_COMMIT}</git.commit>
      </properties>
    </profile>

    <profile>
      <id>java9And10</id>
      <activation>
        <activeByDefault>false</activeByDefault>
        <jdk>[9, 10]</jdk>
      </activation>
      <properties>
        <java.exports>--add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-modules java.xml.bind</java.exports>
        <maven.javadoc.skip>true</maven.javadoc.skip>
        <scala.java.additional.args>-nobootcp</scala.java.additional.args>
      </properties>
    </profile>

    <profile>
      <id>zinc</id>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>net.alchim31.maven</groupId>
              <artifactId>scala-maven-plugin</artifactId>
              <version>${scala-maven-plugin.version}</version>
              <configuration>
                <recompileMode>incremental</recompileMode>
                <useZincServer>true</useZincServer>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
  </profiles>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.apache.lucene</groupId>
        <artifactId>lucene-analyzers-common</artifactId>
        <version>${lucene.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.lucene</groupId>
        <artifactId>lucene-core</artifactId>
        <version>${lucene.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.lucene</groupId>
        <artifactId>lucene-codecs</artifactId>
        <version>${lucene.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.lucene</groupId>
        <artifactId>lucene-queryparser</artifactId>
        <version>${lucene.version}</version>
        <exclusions>
          <exclusion>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-queries</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.apache.lucene</groupId>
            <artifactId>lucene-sandbox</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.apache.shiro</groupId>
        <artifactId>shiro-core</artifactId>
        <version>1.4.0</version>
      </dependency>
      <dependency>
        <groupId>com.github.ben-manes.caffeine</groupId>
        <artifactId>caffeine</artifactId>
        <version>${caffeine.version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-nop</artifactId>
        <version>1.7.25</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.7.25</version>
      </dependency>

      <!-- testing -->
      <dependency>
        <groupId>org.neo4j.driver</groupId>
        <artifactId>neo4j-java-driver</artifactId>
        <version>1.5.2</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.apache.directory.server</groupId>
        <artifactId>apacheds-server-integ</artifactId>
        <version>2.0.0-M21</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava-testlib</artifactId>
        <version>24.1-jre</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
        <version>4.5.2</version>
      </dependency>
      <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
        <version>4.5.2</version>
        <classifier>tests</classifier>
      </dependency>
      <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpcore</artifactId>
        <version>4.4.5</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>1.7.25</version>
        <scope>test</scope>
      </dependency>

      <!-- The JUnit-Hamcrest-Mockito combo -->
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
        <scope>test</scope>
      </dependency>

      <dependency>
          <groupId>org.hamcrest</groupId>
          <artifactId>hamcrest-core</artifactId>
          <version>1.3</version>
          <scope>test</scope>
      </dependency>
      <dependency>
          <groupId>org.hamcrest</groupId>
          <artifactId>hamcrest-library</artifactId>
          <version>1.3</version>
          <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-all</artifactId>
        <version>1.3</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>2.18.3</version>
        <scope>test</scope>
      </dependency>

      <dependency>
        <groupId>commons-codec</groupId>
        <artifactId>commons-codec</artifactId>
        <version>1.11</version>
        <scope>test</scope>
      </dependency>

      <!-- scala -->
      <dependency>
        <groupId>org.scala-lang</groupId>
        <artifactId>scala-library</artifactId>
        <version>${scala.version}</version>
      </dependency>
      <dependency>
        <groupId>org.scala-lang</groupId>
        <artifactId>scala-reflect</artifactId>
        <version>${scala.version}</version>
      </dependency>
      <dependency>
        <groupId>org.scala-lang</groupId>
        <artifactId>scalap</artifactId>
        <version>${scala.version}</version>
      </dependency>

      <!-- scala test dependencies -->
      <dependency>
        <groupId>org.scalatest</groupId>
        <artifactId>scalatest_2.11</artifactId>
        <version>2.2.5</version>
        <scope>test</scope>
        <exclusions>
          <exclusion>
            <artifactId>scala-library</artifactId>
            <groupId>org.scala-lang</groupId>
          </exclusion>
          <exclusion>
            <artifactId>scala-reflect</artifactId>
            <groupId>org.scala-lang</groupId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.scalautils</groupId>
        <artifactId>scalautils_2.11</artifactId>
        <version>2.1.7</version>
        <scope>test</scope>
        <exclusions>
          <exclusion>
            <artifactId>scala-library</artifactId>
            <groupId>org.scala-lang</groupId>
          </exclusion>
          <exclusion>
            <artifactId>scala-reflect</artifactId>
            <groupId>org.scala-lang</groupId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.scalacheck</groupId>
        <artifactId>scalacheck_2.11</artifactId>
        <version>1.12.5</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>com.novus</groupId>
        <artifactId>salat-core_2.11</artifactId>
        <version>1.9.9</version>
        <scope>test</scope>
        <exclusions>
          <exclusion>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
          </exclusion>
          <exclusion>
            <artifactId>scalap</artifactId>
            <groupId>org.scala-lang</groupId>
          </exclusion>
        </exclusions>
      </dependency>

      <!-- other -->
      <dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <version>2.8.2</version>
      </dependency>
      <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.6</version>
      </dependency>
      <dependency>
        <groupId>commons-configuration</groupId>
        <artifactId>commons-configuration</artifactId>
        <version>1.10</version>
        <type>jar</type>
        <scope>compile</scope>
        <exclusions>
          <exclusion>
            <artifactId>commons-digester</artifactId>
            <groupId>commons-digester</groupId>
          </exclusion>
        </exclusions>
      </dependency>
      <!-- Added (directly) to avoid version clash in commons-configuration. -->
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-digester3</artifactId>
        <version>3.2</version>
        <type>jar</type>
        <scope>compile</scope>
        <exclusions>
          <exclusion>
            <groupId>commons-beanutils</groupId>
            <artifactId>commons-beanutils</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>commons-beanutils</groupId>
        <artifactId>commons-beanutils</artifactId>
        <version>1.9.3</version>
        <scope>compile</scope>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.7</version>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-text</artifactId>
        <version>1.3</version>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-compress</artifactId>
        <version>1.16.1</version>
        <exclusions>
          <exclusion>
            <groupId>org.objenesis</groupId>
            <artifactId>objenesis</artifactId>
          </exclusion>
        </exclusions>
      </dependency>

      <!-- Netty is used by three components: Com, Cluster and Bolt Socket Transport.
           Netty 4 is a significant improvement over Netty 3, in that it introduces
           buffer pooling (among lots of other improvements), and thus we want to move
           to Netty 4 to reduce GC overhead. Netty 4 (io.netty:netty-all) can co-exist
           with Netty 3 (io.netty:netty) because they have different modules and different
           package structure. As such, the two netty dependencies represents the in-between
           state while we move all remaining Netty 3 uses over to Netty 4 -->
      <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty</artifactId>
        <version>3.9.9.Final</version>
      </dependency>
      <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-all</artifactId>
        <version>4.1.24.Final</version>
      </dependency>

      <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.17</version>
      </dependency>
      <dependency>
        <groupId>net.sf.opencsv</groupId>
        <artifactId>opencsv</artifactId>
        <version>2.3</version>
      </dependency>
      <dependency>
        <groupId>com.sun.jersey</groupId>
        <artifactId>jersey-client</artifactId>
        <version>${jersey.version}</version>
        <exclusions>
          <exclusion>
            <groupId>javax.ws.rs</groupId>
            <artifactId>jsr311-api</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>com.sun.jersey</groupId>
        <artifactId>jersey-server</artifactId>
        <version>${jersey.version}</version>
        <exclusions>
          <exclusion>
            <groupId>javax.ws.rs</groupId>
            <artifactId>jsr311-api</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>com.sun.jersey</groupId>
        <artifactId>jersey-servlet</artifactId>
        <version>${jersey.version}</version>
        <exclusions>
          <exclusion>
            <groupId>javax.ws.rs</groupId>
            <artifactId>jsr311-api</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-core-asl</artifactId>
        <version>1.9.13</version>
      </dependency>
      <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-jaxrs</artifactId>
        <version>1.9.13</version>
      </dependency>
      <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-mapper-asl</artifactId>
        <version>1.9.13</version>
      </dependency>
      <dependency>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-server</artifactId>
        <version>${jetty.version}</version>
      </dependency>
      <dependency>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-webapp</artifactId>
        <version>${jetty.version}</version>
      </dependency>
      <dependency>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-servlet</artifactId>
        <version>${jetty.version}</version>
      </dependency>
      <dependency>
        <groupId>org.eclipse.jetty.websocket</groupId>
        <artifactId>websocket-client</artifactId>
        <version>${jetty.version}</version>
      </dependency>
      <dependency>
        <groupId>org.mozilla</groupId>
        <artifactId>rhino</artifactId>
        <version>1.7.9</version>
      </dependency>
      <dependency>
        <groupId>org.bouncycastle</groupId>
        <artifactId>bcprov-jdk15on</artifactId>
        <version>${bouncycastle.version}</version>
      </dependency>
      <dependency>
        <groupId>org.bouncycastle</groupId>
        <artifactId>bcpkix-jdk15on</artifactId>
        <version>${bouncycastle.version}</version>
      </dependency>
      <dependency>
        <groupId>org.neo4j.3rdparty.javax.ws.rs</groupId>
        <artifactId>jsr311-api</artifactId>
        <version>1.1.2.r612</version>
      </dependency>
      <dependency>
        <groupId>io.dropwizard.metrics</groupId>
        <artifactId>metrics-core</artifactId>
        <version>${metrics.version}</version>
      </dependency>
      <dependency>
        <groupId>io.dropwizard.metrics</groupId>
        <artifactId>metrics-graphite</artifactId>
        <version>${metrics.version}</version>
        <exclusions>
          <exclusion>
              <groupId>com.rabbitmq</groupId>
              <artifactId>amqp-client</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.jprocesses</groupId>
        <artifactId>jProcesses</artifactId>
        <version>1.6.4</version>
      </dependency>

      <dependency>
        <groupId>com.google.code.findbugs</groupId>
        <artifactId>annotations</artifactId>
        <version>${findbugs.version}</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>com.google.testing.compile</groupId>
        <artifactId>compile-testing</artifactId>
        <version>0.15</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
</project>
