0

I have project on eclipse and it use maven. The project has external jar, that not maintenance in maven repository. So, the jar file will be added throught Java Build Path in eclipse.

When I run junit, the test run successfully. But when I run the test with maven-test, it throw java.lang.NoClassDefFoundError. The error show me, that class in external jar cannot be found. My investigation is, that the maven test cannot read the external jar file.

This error can be solved, when I upload the jar file into maven repository.

The configuration in the Deploment Assembly is not working. The error is still show up.

Does anyone know, how to solve the problem, without upload the external jar file into maven repository?

Thank you

Ndrik7
  • 103
  • 13

1 Answers1

0

Add the external jar to the maven repository using mvn install:install-file command. Then add dependency to this jar in your pom.xml. It should resolve the error. for more on mvn install::install-file: see this link http://www.mkyong.com/maven/how-to-include-library-manully-into-maven-local-repository/.

You can also see the following stackoverflow question Maven: best way of linking custom external JAR to my project?

Hari Prasad
  • 304
  • 1
  • 6
  • So, I think this problem can be solved, when jar is connected to maven. Without connection, the jar cannot be read by maven process. correct me, if I understand not in the same way :) – Ndrik7 Feb 11 '19 at 02:11