maven項目有時候找不到第三方jar包的依賴坐標,這時就需要在項目下建立一個文件夾,將第三方jar包放在此處,在maven打包時將文件夾下的jar包打包進去
在pom.xml中添加如下插件,並指明jar包路徑
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
<compilerArguments>
<extdirs>${project.basedir}/lib</extdirs>
</compilerArguments>
</configuration>
</plugin>
注意:一定要指明具體路徑 ${project.basedir},否則會找不到路徑