简体   繁体   中英

How to build an executable uber-jar also containing source files?

have a little java-Project in Eclipse with maven that I would like to turn into a jar with the following specifications:

  • executable
  • containing all dependencies
  • containing all source files (*.java) besides the compiled *.class files

So far, I've found shade and source as plugin which each serve two of my needs but not all three. Does anyone know how to tweak maven into doing all of the above?

I'm aware of this being an usual request but the goal is to have the source code with the class files in case something goes wrong and nobody remembers which project this came from.

Including the sources has already been answered here

Regarding an executable jar with all the libraries included in a single file, what you're looking for is a fat jar. You can use this plugin for eclipse or Maven to build your jar.

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