0

I create an application that depends on a.jar, which was generated by the spring-boot-maven-plugin. a.jar depends itself on another b.jar, which is located it its lib\ folder. When I start my application, I get the following error:

Exception in thread "main" java.lang.NoClassDefFoundError: some_class_located_in_b.jar

It is possible to add a spring-boot-maven-plugin generated jar to the classpath of a third application? If yes, how?

jeromerg
  • 2,997
  • 2
  • 26
  • 36

1 Answers1

0

The repackaged jar is a "final" artifact and represents your application: you shouldn't have a module dependency on it. The default behaviour of repackage is to replace your regular jar with the one that holds the application.

If the code of project a is meant to be shared as a module, please make sure to specify a classifier for the repackaged jar. That way you can use the regular jar file as a module dependency

There is an example in the documentation

Stephane Nicoll
  • 31,977
  • 9
  • 97
  • 89