Question

I have successfully created a buildfile which builds my application. There is a dependency, which is automatically downloaded to ~/.m2/repository/ and provided at compile time. I can now easily build the application.

The question is: how do I easily start this application with the specified dependencies in the class path?

My build file is:

repositories.remote << 'http://repo1.maven.org/maven2'

JLINE = transitive('jline:jline:jar:1.0')

define 'ishell' do
  project.version = '0.1.0'
  compile.with JLINE
  package :jar
end

Building is now easy: just "buildr". How to run it without describing all dependencies at the command line?

Was it helpful?

Solution

You can add this line to the project definition in the buildfile:

  run.using :main => "org.example.Main"

And now you can run the application with "buildr run"

This is described in a well hidden place: http://buildr.apache.org/more_stuff.html#run

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top