Java (另一个)Neo4j插件没有在扩展中出现

Java (另一个)Neo4j插件没有在扩展中出现,java,scala,neo4j,Java,Scala,Neo4j,像很多有a的人一样,我无法显示我的插件扩展: { "extensions" : { }, "node" : ... } 尝试 使用Java1.7编译了GetAll.java。使用SBT,build.SBT: javaOptions ++= Seq( "-source", "1.7" ) libraryDependencies ++= Seq( "org.neo4j" % "neo4j" % "2.1.3" % "provided" withSources(), "org.n

像很多有a的人一样,我无法显示我的插件扩展:

{
  "extensions" : {
  },
  "node" : ...
}
尝试 使用Java1.7编译了GetAll.java。使用SBT,build.SBT:

javaOptions ++= Seq( "-source", "1.7" )
libraryDependencies ++= Seq(
  "org.neo4j" % "neo4j" % "2.1.3" % "provided" withSources(),
  "org.neo4j" % "server-api" % "2.1.3" % "provided" withSources()
)
非常简单的罐子:

META-INF/
META-INF/MANIFEST.MF
META-INF/services/
META-INF/services/org.neo4j.server.plugins.ServerPlugin
GetAll.class
简单GetAll.class:

package com.danmacias.neo4j.plugin;
import java.util.ArrayList;
import java.util.List;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.Relationship;
import org.neo4j.graphdb.Transaction;
import org.neo4j.server.plugins.Description;
import org.neo4j.server.plugins.Name;
import org.neo4j.server.plugins.PluginTarget;
import org.neo4j.server.plugins.ServerPlugin;
import org.neo4j.server.plugins.Source;
import org.neo4j.tooling.GlobalGraphOperations;

// START SNIPPET: GetAll
package com.danmacias.neo4j.plugin;
import java.util.ArrayList;
import java.util.List;
@Description( "An extension to the Neo4j Server for getting all nodes or relationships" )
public class GetAll extends ServerPlugin
{
  @Name( "get_all_nodes" )
  @Description( "Get all nodes from the Neo4j graph database" )
  @PluginTarget( GraphDatabaseService.class )
  public Iterable<Node> getAllNodes( @Source GraphDatabaseService graphDb )
  {
    ArrayList<Node> nodes = new ArrayList<>();
    try (Transaction tx = graphDb.beginTx())
    {
      for ( Node node : GlobalGraphOperations.at( graphDb ).getAllNodes() )
      {
        nodes.add( node );
      }
      tx.success();
    }
    return nodes;
  }
}
(注意结尾的换行符)

使用neo4j 2.0.2 java版本“1.7.0_71” Java(TM)SE运行时环境(build 1.7.0_71-b14) Java HotSpot(TM)64位服务器虚拟机(构建24.71-b01,混合模式)


这个问题让我快要发疯了:S

您的GetAll类应该位于Jar中的一个目录中:

com/danmacias/neo4j/plugin/GetAll.class

像通常一样,Java jar是打包的。

谢谢!Scala世界已经把我宠坏了,我将不得不保持一点Java心态。
com/danmacias/neo4j/plugin/GetAll.class