<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <!-- =========== -->
    <!-- = General = -->
    <!-- =========== -->
    <groupId>org.neo4j</groupId>
    <artifactId>neo4j-jdbc-parent</artifactId>
    <version>3.0</version>
    <packaging>pom</packaging>
    <name>Neo4j JDBC Driver Parent</name>
    <description>Parent POM for Neo4j JDBC Driver and Modules</description>
    <url>https://github.com/neo4j-contrib/neo4j-jdbc</url>

    <!-- =========== -->
    <!-- = Modules = -->
    <!-- =========== -->
    <modules>
        <module>neo4j-jdbc</module>
        <module>neo4j-jdbc-bolt</module>
        <module>neo4j-jdbc-http</module>
        <module>neo4j-jdbc-driver</module>
    </modules>

    <!-- =========== -->
    <!-- = Licence = -->
    <!-- =========== -->
    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <!-- ================ -->
    <!-- = Organization = -->
    <!-- ================ -->
    <organization>
        <name>LARUS Business Automation Srl</name>
        <url>http://www.larus-ba.it</url>
    </organization>

    <!-- ============== -->
    <!-- = Developers = -->
    <!-- ============== -->
    <developers>
        <developer>
            <id>albertodeste</id>
            <name>Alberto D'Este</name>
            <email>alberto.deste@larus-ba.it</email>
        </developer>
        <developer>
            <id>mfalcier-larus</id>
            <name>Marco Falcier</name>
            <email>marco.falcier@larus-ba.it</email>
        </developer>
        <developer>
            <id>glaggia-larus</id>
            <name>Gianmarco Laggia</name>
            <email>gianmarco.laggia@larus-ba.it</email>
        </developer>
    </developers>

    <!-- ============================= -->
    <!-- = Source Control management = -->
    <!-- ============================= -->
    <scm>
        <connection>scm:git:git@github.com:neo4j-contrib/neo4j-jdbc.git</connection>
        <developerConnection>scm:git:git@github.com:neo4j-contrib/neo4j-jdbc.git</developerConnection>
        <url>git@github.com:neo4j-contrib/neo4j-jdbc.git</url>
    </scm>

    <!-- ============================= -->
    <!-- = Properties                = -->
    <!-- ============================= -->
    <properties>
        <!-- General -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.version>1.7</java.version>

        <!-- Deps version -->
        <powermock.version>1.6.2</powermock.version>
        <junit.version>4.12</junit.version>
        <jmh.version>1.12</jmh.version>
        <powermock.version>1.6.4</powermock.version>
        <neo4j.java.driver.version>1.0.3</neo4j.java.driver.version>
        <neo4j.version>3.0.2</neo4j.version>
        <httpclient.version>4.3.4</httpclient.version>
        <jackson.version>2.7.0</jackson.version>

        <!-- Plugin version -->
        <maven.plugin.compiler>3.5.1</maven.plugin.compiler>
        <maven.plugin.resources>2.7</maven.plugin.resources>
        <maven.plugin.nexus-staging>1.6.3</maven.plugin.nexus-staging>
        <maven.plugin.shade>2.4.3</maven.plugin.shade>
        <maven.plugin.javadoc>2.9.1</maven.plugin.javadoc>
        <maven.plugin.source>2.2.1</maven.plugin.source>
        <maven.plugin.gpg>1.5</maven.plugin.gpg>
        <maven.plugin.surefire>2.12.4</maven.plugin.surefire>
    </properties>

    <!-- ============================= -->
    <!-- = Dependency management     = -->
    <!-- ============================= -->
    <dependencyManagement>
        <dependencies>
            <!-- Inter-module dependencies -->
            <dependency>
                <groupId>org.neo4j</groupId>
                <artifactId>neo4j-jdbc</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.neo4j</groupId>
                <artifactId>neo4j-jdbc-bolt</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.neo4j</groupId>
                <artifactId>neo4j-jdbc-http</artifactId>
                <version>${project.version}</version>
            </dependency>

            <!-- Deps to the HTTP client -->
            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpclient</artifactId>
                <version>${httpclient.version}</version>
            </dependency>
            <!-- Deps to Jackson for JSON manipulation -->
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${jackson.version}</version>
            </dependency>

            <!-- Deps to Neo4j java driver -->
            <dependency>
                <groupId>org.neo4j.driver</groupId>
                <artifactId>neo4j-java-driver</artifactId>
                <version>${neo4j.java.driver.version}</version>
            </dependency>
            <!-- Deps to Neo4j -->
            <dependency>
                <groupId>org.neo4j</groupId>
                <artifactId>neo4j-kernel</artifactId>
                <version>${neo4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.neo4j.test</groupId>
                <artifactId>neo4j-harness</artifactId>
                <version>${neo4j.version}</version>
            </dependency>

            <!-- Deps to test framework -->
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
            </dependency>
            <dependency>
                <groupId>org.powermock</groupId>
                <artifactId>powermock-module-junit4</artifactId>
                <version>${powermock.version}</version>
            </dependency>
            <dependency>
                <groupId>org.powermock</groupId>
                <artifactId>powermock-api-mockito</artifactId>
                <version>${powermock.version}</version>
            </dependency>

            <!-- Deps for performance tests -->
            <dependency>
                <groupId>org.openjdk.jmh</groupId>
                <artifactId>jmh-core</artifactId>
                <version>${jmh.version}</version>
            </dependency>
            <dependency>
                <groupId>org.openjdk.jmh</groupId>
                <artifactId>jmh-generator-annprocess</artifactId>
                <version>${jmh.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <!-- ============================= -->
    <!-- = Dependency                = -->
    <!-- ============================= -->
    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-api-mockito</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.powermock</groupId>
            <artifactId>powermock-module-junit4</artifactId>
            <scope>test</scope>
        </dependency>
        <!-- Deps to Neo4j for test -->
        <dependency>
            <groupId>org.neo4j</groupId>
            <artifactId>neo4j-kernel</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.neo4j.test</groupId>
            <artifactId>neo4j-harness</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <!-- ========= -->
    <!-- = Build = -->
    <!-- ========= -->
    <build>
        <!-- Enable filter resources -->
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <plugins>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>${maven.plugin.nexus-staging}</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven.plugin.compiler}</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${maven.plugin.source}</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven.plugin.javadoc}</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>${maven.plugin.shade}</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <transformers>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
                            </transformers>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <!-- =========== -->
    <!-- = Profile = -->
    <!-- =========== -->
    <profiles>
        <!-- Profile used in the release process -->
        <profile>
            <id>release-sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${maven.plugin.source}</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${maven.plugin.javadoc}</version>
                        <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>${maven.plugin.gpg}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>${maven.plugin.nexus-staging}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!-- Just run IT test -->
        <profile>
            <id>dev</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>${maven.plugin.surefire}</version>
                        <configuration>
                            <includes>
                                <include>**/*IT.java</include>
                                <include>**/*Test.java</include>
                            </includes>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!-- Just run IT test -->
        <profile>
            <id>integration-test</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>${maven.plugin.surefire}</version>
                        <configuration>
                            <includes>
                                <include>**/*IT.java</include>
                            </includes>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!-- Just run Performance test -->
        <profile>
            <id>performance-test</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>${maven.plugin.surefire}</version>
                        <configuration>
                            <includes>
                                <include>**/*PT.java</include>
                            </includes>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <!-- =========================== -->
    <!-- = Distribution management = -->
    <!-- =========================== -->
    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <!-- ================ -->
    <!-- = Repositories = -->
    <!-- ================ -->
    <repositories>
        <!-- Adding neo4j repository to have snapshot -->
        <repository>
            <id>neo4j-snapshot-repository</id>
            <name>Neo4j Maven 2 snapshot repository</name>
            <url>http://m2.neo4j.org/content/repositories/snapshots</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <releases>
                <enabled>false</enabled>
            </releases>
        </repository>
    </repositories>

</project>
