如何运行使用 buildr 并使用依赖项构建的 java 应用程序?
我已经成功创建了一个构建我的应用程序的构建文件。有一个依赖项,它会自动下载到 ~/.m2/repository/ 并在编译时提供。我现在可以轻松构建应用程序。
问题是:如何使用类路径中指定的依赖项轻松启动该应用程序?
我的构建文件是:
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
构建现在很容易:只需“buildr”。如何在命令行中不描述所有依赖项的情况下运行它?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以将此行添加到构建文件中的项目定义中:
现在您可以使用“buildr run”运行应用程序
这在一个隐藏的地方进行了描述: http://buildr.apache.org/more_stuff.html#run
You can add this line to the project definition in the buildfile:
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