Maven references custom jar package


In the project, a third-party jar package that is not available in Maven's central warehouse is used. How to rely on it in Maven?
If the introduction is not good, the following will be reported when starting the project:

java.lang.ClassNotFoundException exception

Import jar

In the src directory of the project, create a new lib directory, and then drag the jar package to this directory

Introducing dependency into pom

  • version is custom
  • groupId is written according to the package level of jar package type
  • artifactId the name of the jar package I used directly

Add Maven dependency plugin


After packing, in the jar package, go to the directory / WEB-INF/lib, and you can see that bcprov-jdk15on-154.jar has been typed in.

Environmental description

  • Maven version: Apache Maven 3.3.9
  • Java version: 1.7.0_80
  • OS name: "mac os x", version: "10.13.3"

Tags: Maven Java Apache Mac

Posted on Sun, 05 Apr 2020 09:23:37 -0700 by GreenSmurf