QUARKUS quarkusBuild uber jar to specific location

余生长醉 提交于 2020-01-06 04:50:16

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!