This time a project was used by Maven to compile, I was in the local development of the jar package is placed in the Web-inf/lib directory, through
BuildPath imports the jar package and then uses the MyEclipse: Maven Package Command to fight the war packet, which runs under Tomcat and has a jar package under Lib under the war package.
But I upload to the server is the project source code, with SVN upload, and then the server with the Maven plugin compiled run, compile times wrong: Web-inf/lib can not find the jar package. Obviously maven compiles without automatically loading the jar package under Web-inf/lib.
The project's jar package is partially downloaded from the MAVEN library, partially placed under local web-inf/lib, where the local jar package is not found in the MAVEN library. This requires MAVEN to both load the jar package in the MAVEN library and load the local web-inf/lib
Jar package.
Now it's time to solve the problem by adding a configuration to the Pom.xml file:
<plugin> <groupId>Org.apache.maven.plugins</groupId> <Artifactid>Maven-compiler-plugin</Artifactid> <version>3.6.0</version> <Configuration> <Source>1.8</Source> <Target>1.8</Target> <encoding>UTF-8</encoding> <compilerArguments> <extdirs>${project.basedir}/src/main/webapp/web-inf/lib;${proje Ct.basedir}/src/main/resources/lib</extdirs> </compilerArguments> </Configuration> </plugin>
Extended:
In addition, put under the resources package is also possible, if more than one LIB package, only need to be in the middle of multiple paths with a semicolon ";" Partition (Windows environment),
In a Linux environment, separate the word ":" with a colon and wait for verification
Fix the problem with Maven failing to load the jar package under local lib/(package XXX does not exist)