<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>
  <parent>
    <groupId>org.neo4j</groupId>
    <artifactId>parent</artifactId>
    <version>3.4.0-alpha08</version>
  </parent>

  <groupId>org.neo4j</groupId>
  <artifactId>commercial-parent</artifactId>
  <version>3.4.0-alpha08</version>

  <packaging>pom</packaging>
  <name>Neo4j</name>
  <description>Neo4j Graph Database</description>

  <modules>
    <module>enterprise</module>
    <module>packaging</module>
  </modules>

  <licenses>
    <license>
      <name>Neo4j Commercial license</name>
      <comments>
        Copyright (c) 2002-2018 "Neo Technology,"
        Network Engine for Objects in Lund AB [http://neotechnology.com]
        This file is a commercial add-on to Neo4j Enterprise Edition.
      </comments>
    </license>
  </licenses>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>2.17</version>
        <configuration>
          <configLocation>build/checkstyle.xml</configLocation>
          <consoleOutput>true</consoleOutput>
          <logViolationsToConsole>true</logViolationsToConsole>
          <failsOnError>true</failsOnError>
          <failOnViolation>true</failOnViolation>
          <includeTestSourceDirectory>true</includeTestSourceDirectory>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>com.puppycrawl.tools</groupId>
            <artifactId>checkstyle</artifactId>
            <version>8.2</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <id>validate</id>
            <phase>none</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <!--
      The first plugin simply sets up the license headers.
      The other two override the parent config to disable any community license checks, header checks etc.
      Eventually, once we sanitize our use of licensing plugins this will be simplified.
      -->
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>2.5</version>
        <configuration>
          <header>license-header.txt</header>
          <properties>
            <owner>Neo Technology,</owner>
            <year>${project.inceptionYear}</year>
          </properties>
          <mapping>
            <java>SLASHSTAR_STYLE</java>
            <ps1>SCRIPT_STYLE</ps1>
            <psm1>SCRIPT_STYLE</psm1>
            <psd1>SCRIPT_STYLE</psd1>
            <bar>BATCH</bar>
          </mapping>
          <includes>
            <include>**/*.java</include>
            <include>**/*.ps1</include>
            <include>**/*.psm1</include>
            <include>**/*.psd1</include>
            <include>**/*.bat</include>
          </includes>
        </configuration>
        <executions>
          <execution>
            <phase>compile</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.neo4j.build.plugins</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>check-licenses</id>
            <phase>none</phase>
          </execution>
          <execution>
            <id>list-all-licenses-win</id>
            <phase>none</phase>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.neo4j.build.plugins</groupId>
        <artifactId>licensing-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>enforce-licensing-oss</id>
            <phase>none</phase>
          </execution>
          <execution>
            <id>enforce-licensing-com</id>
            <phase>none</phase>
          </execution>
          <execution>
            <id>list-all-licenses</id>
            <phase>none</phase>
          </execution>
          <execution>
            <id>list-all-licenses-win</id>
            <phase>none</phase>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>org.neo4j.build</groupId>
            <artifactId>licensecheck-config</artifactId>
            <version>${project.version}</version>
          </dependency>
        </dependencies>
      </plugin>
      <!--<plugin>put some stuff here</plugin>-->
    </plugins>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-failsafe-plugin</artifactId>
          <configuration>
            <!-- Integration tests spend significant time waiting, so we can run more things in parallel here-->
            <forkCount>1C</forkCount>
            <!-- Misha says it is not safe to run tests with more than one thread per JVM -->
            <!-- He also said he'd fix that! -->
            <threadCount>1</threadCount>
            <!-- slowest test class takes up to 10 minutes, so let's cater for that, with contingency -->
            <parallelTestsTimeoutInSeconds>1200</parallelTestsTimeoutInSeconds>
            <parallelTestsTimeoutForcedInSeconds>1800</parallelTestsTimeoutForcedInSeconds>
            <!-- file system separation between forks -->
            <workingDirectory>${project.build.directory}/FORK_DIRECTORY_${surefire.forkNumber}</workingDirectory>
            <systemPropertyVariables>
              <!-- coordination on ports between forks -->
              <port.authority.directory>${user.dir}/target/port-authority-${maven.build.timestamp}</port.authority.directory>
            </systemPropertyVariables>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>


</project>
