Neo4j Server Maven Plugin

Start and stop any version of Neo4j community server

License

License

Categories

Categories

Maven Build Tools Neo4J Data Databases
GroupId

GroupId

com.github.harti2006
ArtifactId

ArtifactId

neo4j-server-maven-plugin
Last Version

Last Version

1.2
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

Neo4j Server Maven Plugin
Start and stop any version of Neo4j community server
Project URL

Project URL

https://github.com/harti2006/neo4j-server-maven-plugin
Source Code Management

Source Code Management

https://github.com/harti2006/neo4j-server-maven-plugin

Download neo4j-server-maven-plugin

How to add to project

<plugin>
    <groupId>com.github.harti2006</groupId>
    <artifactId>neo4j-server-maven-plugin</artifactId>
    <version>1.2</version>
</plugin>

Dependencies

compile (5)

Group / Artifact Type Version
org.apache.maven : maven-plugin-api jar 3.2.5
commons-io : commons-io jar 2.4
org.rauschig : jarchivelib jar 1.0.0
org.springframework : spring-web jar 4.1.4.RELEASE
org.neo4j.driver : neo4j-java-driver jar 1.4.5

provided (1)

Group / Artifact Type Version
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.4

Project Modules

There are no modules declared in this project.

Neo4j Server Maven Plugin

It may get hard to update the existing neo4j-maven-plugin and make it use the latest versions of Neo4j, because it depends on deprecated classes, which are very likely to be moved to some internal packages in the future.

So I decided to write another small Maven plugin, that simply downloads the complete Neo4j server artifact, and runs it, as a user would do it, using ./neo4j start

Furthermore it provides an idiomatic way to configure the server using the plugin <configuration> section.

Building the project

mvn clean install

Usage

start

mvn neo4j-server:start

stop

mvn neo4j-server:stop

Integration Testing

The start/stop goals bind by default to lifecycle phases pre- and post-integration-test:

<plugin>
    <groupId>com.github.harti2006</groupId>
    <artifactId>neo4j-server-maven-plugin</artifactId>
    <version>1.0-SNAPSHOT</version>
    <configuration>
        <port>${neo4j-server.port}</port>
        <version>${neo4j-server.version}</version>
    </configuration>
    <executions>
        <execution>
            <id>start-neo4j-server</id>
            <goals>
                <goal>start</goal>
            </goals>
        </execution>
        <execution>
            <id>stop-neo4j-server</id>
            <goals>
                <goal>stop</goal>
            </goals>
        </execution>
    </executions>
</plugin>

For an example, run

cd integration-tests
mvn clean verify

Parameters

Have a look at the Neo4jServerMojoSupport class for details.

Code Formatting

File formatting is verified by EditorConfig during mvn verify step. Most errors can be fixed with mvn editorconfig:format task.

Releases

The release process is copied frome this blog post:

  • Snapshot releases to Maven Central are performed automatically by Travis CI on every push to master.
  • Final releases to Maven Central are performed automatically by Travis CI after creating and pushing a git tag.

Versions

Version
1.2
1.1
1.0.1
1.0
0.1