来自文档here。
如果我拥有quarkus.package.uber-jar=true
然后我建造。
./gradlew clean quarkusBuild
我都有:
1. /myapp/build/libs/my-app.jar (no sure what is the use of it with no deps, no lib/ folder created)
2 /my/app/build/my-app-runner.jar
问:如何控制Runner.jar的名称和位置? (例如我也想将其放到libs /中)
更新:
尝试添加新任务,以在quarkusBuild完成后将Uber jar复制到/ libs
task quarkusUberToLibs() {
print ("\nquarkusUberToLibs task")
print "\n Copying from : ${buildDir} with *-runner.jar to ${buildDir}/libs/ replacing -runner to ''"
String resultingJarName
copy {
from "${buildDir}"
include "*-runner.jar"
into "${buildDir}/libs/"
rename { String fileName ->
print ("\ngot fileName: " + fileName)
resultingJarName = fileName.replace("-runner", "")//.replace("-SNAPSHOT", "")
}
}
final String sizeInMegabytes = new File("${buildDir}/libs/" + resultingJarName).length() / 1024 / 1024
print "\nresulting jar:" + resultingJarName + " with file length: " + sizeInMegabytes + " Mb."
}
uberToLibs本身可以工作,但是当我从命令行运行它时:
./gradlew clean quarkusBuild quarkusUberToLibs
似乎quarkusBuild
即将运行时,quarkusUberToLibs
仍在做某事,并且最终拾取了一个很小的/不是超级的jar。我可以从打印文件中看到它(404 kb,而不是42 Mb)