0

I am provided with fat JAR's. Now I want to build a spring boot REST webservice for each. The webservice needs to use the classes and libraries in the fat JAR. Unfortunately the JAR'S in the lib folder of the fat JAR are not used by either maven or the IDE out of the box.

The only working solution I found so far is to unzip the fat JAR and then add the libs folder to my project.

How do I use the fat JAR with my spring boot webservice?

  • Is this `fat JAR` produced by Spring Boot ? – khmarbaise Nov 12 '17 at 15:36
  • No, it is produced by a codegenerator. – Tobias Poetschke Nov 12 '17 at 20:26
  • I think you could use `maven-shade-plugin` or `assembly-plugin` as well to create kind of an uber jar containing all the required jars in unpacked form (flat), so at the end you've got on big normal jar with any dependency. See [this question](https://stackoverflow.com/questions/39132906) or [this one](https://stackoverflow.com/questions/1832853). And I'm pretty sure Gradle can deal directly with a real fat jar (jars in jar), maybe there's a Maven plugin for this as well. – Robin Nov 13 '17 at 11:04

1 Answers1

0

First what are the dates jars?do they contain spring annotations? You could create a spring boot project as a wrapper and write your own rest controllers to interface with the fat jars. It's hard to provide you more direction without understanding what the fat jars are

ndrone
  • 3,524
  • 2
  • 23
  • 37
  • Yes you got it right. I want to create a a spring boot project as wrapper. The fat JAR contains some classes that I can reach without problems. This is the custom generated code. Now the fat JAR also contains other JARs, which are libraries, necessary to execute the custom code. Example libraries would be apache commons, apache poi or proprietary libraries. I only want to access the custom code. I don't want to access the libraries directly, but the custom code needs them to run. – Tobias Poetschke Nov 13 '17 at 06:46