maven打包时,lib文件夹下的jar无法加载(程序包不存在)
程序能正常run、debug,但是使用maven进行 package打包时,却出现" java: 程序包xxxx不存在"的问题。解决办法如下:
在pom.xml中加入如下代码:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<source>11</source>
<target>11</target>
<encoding>UTF-8</encoding>
<compilerArguments>
<extdirs>${project.basedir}/src/main/webapp/WEB-INF/lib</extdirs>
</compilerArguments>
</configuration>
</plugin>
问题解决。