Pergunta

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?

Foi útil?

Solução

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top