Skip to content
This repository has been archived by the owner on Dec 5, 2023. It is now read-only.

Commit

Permalink
Update README to be in-line with recent changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Kleppmann committed Jun 11, 2009
1 parent 2e51f83 commit 66c62e7
Showing 1 changed file with 33 additions and 12 deletions.
45 changes: 33 additions & 12 deletions README.md
Expand Up @@ -17,7 +17,7 @@ examples of how to write tests. You'll be up and running in no time.
How to use this template
------------------------

You need a Java 6 environment and Maven 2.0.9 or newer installed.
You need a Java 5 environment and Maven 2.0.9 or newer installed.

Download this repository, or clone it with `git`, or merge it into your own
git repository. You will probably want to
Expand All @@ -29,16 +29,10 @@ Out of the box, this template is set up to support the following goals:
* `mvn package` -- Compile, test and bundle into a `war` file for deployment to
a standard Java web container (e.g. Tomcat).
* `mvn test` -- Just compile and test.
* `mvn glassfish:run` -- Compile and run the app in an embedded Glassfish server
on `http://localhost:8080/neo4j-scala-template/`.
* `mvn jetty:run` -- Compile and run the app in an embedded Jetty server
on `http://localhost:8080/`.
* `mvn clean` -- Remove build files

When you're developing using the embedded Glassfish instance, I suggest that you
keep another terminal open; whenever you want to reload, type `mvn compile` in
the terminal, then hit Enter in the terminal running Glassfish. That will reload
the application, enabling a fairly rapid development cycle. (It's still not great
though. If you have an idea to make it faster, please let me know.)

To use the project in Eclipse, you must have the Eclipse Scala plugin installed.
You should also do a full Maven build before using Eclipse, to ensure you have
all the dependencies.
Expand All @@ -47,16 +41,43 @@ Workspace" and be ready to go. Note that at the time of writing, the Eclipse Sca
plugin appears to have a bug which causes it not to write any class files to the
target directory.

This project includes an example resource called `neo_resource`, which you can use
as basis to get started. Just run `mvn jetty:run` and use [cURL](http://curl.haxx.se/)
to access the REST API:

$ curl -i -HAccept:application/json -HContent-type:application/json \
-d'{"name":"my first test node","_out":{"KNOWS":0}}' -XPOST \
http://localhost:8080/neo_resource

$ curl -i -HAccept:application/json http://localhost:8080/neo_resource/0

(This example uses the assumption that a node with ID 0 exists, which is Neo's
reference node in the current implementation -- you shouldn't rely on the
reference node having ID 0 though.)


Troubleshooting
---------------

If you're using a Java 6 JDK, you may get an error like "JAXB 2.0 API is being
loaded from the bootstrap classloader, but this RI needs 2.1 API" when executing
`mvn jetty:run`. You can fix this by setting the following environment variable:

export MAVEN_OPTS="-Djava.endorsed.dirs=$HOME/.m2/repository/javax/xml/bind/jaxb-api/2.1"

Depending on your operating system you may need to to adjust the path above to point
to your Maven repository.


Useful links
------------

The main references you'll need for development:

* [Scala standard library reference](http://www.scala-lang.org/docu/files/api/index.html)
* Jersey Javadoc
* Neo4j Javadoc
* Scalatest
* [Jersey Javadoc](https://jsr311.dev.java.net/nonav/releases/1.0/index.html)
* [Neo4j Javadoc](http://api.neo4j.org/current/)
* [Scalatest](http://www.artima.com/scalatest/doc-0.9.5/index.html)


License
Expand Down

0 comments on commit 66c62e7

Please sign in to comment.