0
  1. I have a maven rest server
  2. It uses a maven based jar file
  3. This maven based jar file is linked to a non maven other jar file.

Everything compiles perfectly.

But, when sending a request on the rest server, I get a NoClassDefFoundError exception on some class from the non maven jar.

Any ideas about this problem?

dushkin
  • 1,939
  • 3
  • 37
  • 82
  • Is the class-path set up correctly? I don't think maven will set this up for non-maven files. You might want to only use maven-jar files, it's not hard to just install a non-maven jar file as artifact to your maven repository. – tkausl Jun 21 '16 at 11:19

1 Answers1

0

I call "maven based jar file" jarA and "non maven jar" jarB.

  1. add jarB to your local maven repository, following this guide.

  2. add jarB to the dependencies of jarA (via pom.xml of jarA). Use the same maven coordinates for jarB from the first step.

  3. on the REST service, call mvn clean package, then deploy it

JimHawkins
  • 4,843
  • 8
  • 35
  • 55