here is what i am trying to accomplish:
Build an uberJar for the EndToEndFunctionalTests tests :
task uberJar(type: Jar,dependsOn:[':compileGroovy']) {
zip64 true
from files(sourceSets.main.output.classesDir)
from configurations.runtime.asFileTree.files.collect {zipTree(it) }
with jar
}
as a result, i get:
EndToEndFunctionalTests-develop.local.SNAPSHOT.jar
so what i am trying to do is to execute this as:
$ java -jar EndToEndFunctionalTests-develop.local.SNAPSHOT.jar
no main manifest attribute, in EndToEndFunctionalTests-develop.local.SNAPSHOT.jar
is there a way to fake a main() and include it in the MANIFEST, so this jar executes.
I was able to run cucumber tests from the command line via gradle using cucumber runner, but what i want is to be able to run the jar because:
答案 0 :(得分:0)
src/main/groovy/Test.groovy
class Test{
public static void main(String[] args){
println 'dummy main'
}
和结果:
java -jar Serenity-develop.local.SNAPSHOT.jar
dummy main
它是可执行的,但现在我必须弄清楚我是否可以从这个类中调用黄瓜跑步者