tags:

views:

75

answers:

2

This is probably simple for someone experienced with it, but this is my first JVM adventure. I just compiled this scala library (per the instructions on that page) and all it appeared to do was give me a bunch of .class files.

What do I have to do to use these in my project? I'm using netbeans if that matters.

+4  A: 

Running mvn compile does what you've seen - it compiles the source files to .class files (it will also any process resources defined in the project as well).

You can use another Maven command: mvn package to create a jar file, then use that as a you would any other jar file. In Netbeans the simplest thing to do would be to copy the jar to your project and add it to the project's classpath.

The project you have compiled "adds object serialization capabilities on top of dispatch-json ", so you can define your own type that uses the library to serialise and deserialise objects to json by calling the in() and out() methods of serializer respectively.

The readme.txt in the github page you reference lists some examples of usage.

Rich Seller
Thanks, mvn package is what I was looking for.
ryeguy
+1  A: 

Rich's answer is perfectly valid. However, I'd recommend to use the mvn install goal (actually, it's a build phase in maven's jargon) because mvn install will install the package into the local repository, for use as a dependency in other projects locally. Check out the Introduction to the Build Lifecycle if you want to learn a bit more about how the whole thing is working in Maven.

Pascal Thivent