Embedding Neo4j?

jxm894 August 13, 2013

My plugin needs a tiny graph database (Neo4j) support. May I add some Neo4j jar files in plugin?

"It’s easy to use Neo4j embedded in Java applications". <http://docs.neo4j.org/chunked/stable/tutorials-java-embedded.html>, but how to use Neo4j embedded in Confluence Plugin.

Thanks in advance,

jxm894

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Joe Clark
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 13, 2013

Hi,

Embedding a third-party library within your plugin is pretty straight-forward. If you are using Maven to build your plugin, you just need to include the artifact as a dependency in Maven with a "compile" scope (which is the default). You'll have to add something like this to your pom.xml:

&lt;dependency&gt;
   &lt;groupId&gt;org.neo4j&lt;/groupId&gt;
   &lt;artifactId&gt;neo4j&lt;/artifactId&gt;
   &lt;version&gt;1.9.2&lt;/version&gt;
&lt;/dependency&gt;

From this point you can just start writing code in your plugin that uses Neo4j. One thing you will need to do is pick a location on disk where the database file will be stored. In order to ensure that the contents of the database is backed up and restored by your Confluence administrator, you should store the database in the Confluence Home Directory (this is where Confluence stores attachments and other file system data).

There is a Java API you can use to determine where the administrator has configured the Home directory - https://developer.atlassian.com/pages/viewpage.action?pageId=2031784

The one caveat that I should mention up-front is that using and storing a database in the Confluence Home directory will make your plugin incompatible with Clustered licenses of Confluence, if that's what you are using.

jxm894 August 14, 2013

Thanks Joseph, much appreciated.

"Another notable development is Neo4j Mobile for Android, and attempts to bring a graph database to Google’s mobile operating system...

How to use Neo4j Embedded.

There are two ways to use the embedded database in your app.

  • Reference the neo4j-android project as an Android library project.

  • ... or just copy the neo4j-android.jar and use it like any other external Java library"

-- from <https://github.com/neo4j-contrib/neo4j-mobile-android>

I hope Atlssian will brinng a graph database Neo4j (embadded) to confluence as well. Thanks

-jxm894

todor kolev April 20, 2014

Hi,

How about if my third party lib of interest has transient dependencies on spring with version < or > atlassianContainer.SpringFrameworkVersion (e.g. the lib I am importing has transient dependencies for springframework.beans 3 but the one probvided by JIRA for example is 2.5.6.SEC2)

Chun-Chi Su December 6, 2016

What are the options if we want to make it compatible with clustered instances?

TAGS
AUG Leaders

Atlassian Community Events