Maven relies on jar packages in local non-repository-handling of client compilation errors when jar packages are placed in directories such as WEB-INF/lib
MAVEN
Today, when packaging a web application using maven compilation, I encountered a problem:
The project introduced the dependency jar package in the development, placed it in the WEB-INF/lib directory, and imported the web libariary through buildpath.
There's no problem with developing in eclipse, but it's cheap to start with maven compiling plug-ins and you can't always find the classes in the jar package WEB-INF/lib.
Obviously, WEB-INF/lib is not configured in the maven-complier-plugin plug-in src directory at compile time.
So add this directory, it still doesn't work. Scoundrel, first install this jar package into the local library, and then add dependency.
Later, google found that maven provides a dependency on scope for system. The original text of the document is as follows:
System
This scope is similar to provided except that you have to provide the JAR which contains it explicitly.
The artifact is always available and is not looked up in a repository.
This allows you to add dependency without having to install the jar package in the WEB-INF/lib directory into the local library.
Record the specific configuration:
Xml code
Org.apache
Test
1.0
System
${basedir} / src/main/webapp/WEB-INF/lib/paypal_base.jar
! A better way is to configure the compilation parameters and add extdirs to add the relative path of the jar package to the configuration, as follows:
Maven-compiler-plugin
1.6
1.6
UTF-8
Src\ main\ webapp\ WEB-INF\ lib
Get [download address]