简体   繁体   中英

How can I create an executable uber jar for spring boot with gradle?

I'm aware that with the traditional "gradle build" command I can create what Spring boot calls an "executable jar".

This jar contains all the jar dependencies needed inside the jar's lib folder.

What I need is that, instead of copying the dependency jars inside the lib folder inside the executable jar, I want a full blown uber jar, that instead of having its dependencies as jars inside a lib folder, I need them extracted as packages/classes.

I already tried the shadow plugin to no avail, and I see nowhere how to create an uber jar, actually most Spring users and the documentation tend to mix in the uber jar term with the executable jar, so it's hard to get developers to understand that they are different packaging strategies even though the result tends to function the same way when running the java -jar command.

查看shadow gradle插件,它可以满足您的需求

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM