Search code examples
mavenneo4jpom.xmljung

Adding Jung dependencies to Neo4j server plugin extensions


Hi I am trying to experiment with Neo4j server plugins. The pom.xml file that I am using is exactly the same as in - https://github.com/neo4j/neo4j/blob/2.1.3/community/server-examples/pom.xml

And the server plugin extension that I am experimenting with is - https://github.com/neo4j/neo4j/blob/2.1.3/community/server-examples/src/main/java/org/neo4j/examples/server/plugins/GetAll.java

This works fine, but then I decide to make some calls to the Jung library from GetAll.java. So I simply add the following lines to the above pom.xml

<dependency>
    <groupId>net.sf.jung</groupId>
    <artifactId>jung-algorithms</artifactId>
    <version>2.0.1</version>
</dependency>

I was hoping that it would compile but it didn't. Instead I get this error :-

[ERROR] Failed to execute goal org.neo4j.build.plugins:licensing-maven-plugin:1.7.5:check (enforce-licensing-oss) on project neo4j-server-examples: This project has 4 disliked artifacts and 1 artifact missing licensing information. -> [Help 1]     

So it seems like it is a license check issue. So I went ahead and added the following lines in the above pom.xml under their section

<!-- http://jung.sourceforge.net/license.txt -->
                 <name>The BSD License</name>
                <url>http://jung.sourceforge.net/license.txt</url>
                <distribution>repo</distribution>

(As Jung2 uses the BSD license) But the error still seems to be there. I tried searching for "licensing-maven-plugin" in the above pom.xml (to disable it) but couldn't find it.

Removing the properties section completely from the above pom.xml (in order to disable license checks) doesn't work either (I get the following error instead -

[ERROR] Failed to execute goal org.neo4j.build.plugins:license-maven-plugin:3:check (check-licenses) on project neo4j-server-examples: Some files do not have the expected license header -> [Help 1])

Any insights on what changes to make to the pom.xml file so that it accepts the Jung dependencies ? Do I need to make changes to the associated NOTICE.txt ?


Solution

  • The pom.xml you're referencing uses org.neo4j.parent as parent pom. This one incorporates automatic license checks for all included artifacts. Neo4j uses this to ensure license compliance.

    In you're plugin project you probably don't need this so try to get rid of the parent pom by commenting out the <parent> tag.