问题
From the doc here.
If I property quarkus.package.uber-jar=true
then if I build .
./gradlew clean quarkusBuild
I got both:
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
Q: how would I control the name of the runner.jar and the location? (say I would like to put it to libs/ too)
UPDATE:
Tried adding new task that would copy the Uber jar to /libs after quarkusBuild has finished
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."
}
The uberToLibs works by itself, but when I run it from command line:
./gradlew clean quarkusBuild quarkusUberToLibs
seems as quarkusBuild
still doing something when the quarkusUberToLibs
is about to run, and it end-up picking up a small / not uber jar. I can see it from the print(404 kb instead of 42 Mb)
来源:https://stackoverflow.com/questions/59362663/quarkus-quarkusbuild-uber-jar-to-specific-location