heldt heldt - 1 year ago 164
Java Question

spring boot application as maven depency

I have an existing spring boot application that I would like to have as a dependency in my other project. I want to use classes from the spring boot application.

Maven downloads the artifact and all checks out but intellij and eclipse can't find the classes.

When I dig in to the external libs I find all classes in the "BOOT-INF" folder inside of the jar. Other jars have their packages in the root of the jar, so I figure this is the problem.

What can I do fix this?

I can change stuff in the original spring boot application.

Answer Source

This is covered in Spring Boot's documentation. In a nutshell, you need to configure your build to use a classifier for the repackaged fat jar so that you can use the original jar as a dependency:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download