开发者

Pulling a gradle dependency jar from maven and then running it directly?

Is there a way in gradle to specify a dependency (a jar), and then run t开发者_高级运维hat jarfile directly within a task?


Here is one way:

configurations {
    tool
}

dependencies {
    tool "some:tool:1.0"
}

task runTool(type: JavaExec) {
    main = "some.tool.Main"
    classpath configurations.tool
}

If you don't know the main class and/or want to do the equivalent of java -jar, you need to employ a workaround as described in http://issues.gradle.org/browse/GRADLE-1274.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜