关于Maven项目运行时期lib下的jar包无法找到的问题

集成Mybatis分页插件的时候由于改动了一些源码所以自己的Mybatis分页插件打成了一个jar包放在lib目录下:

但是当项目运行时,却报错说找不到这个包

原因是因为pom.xml中没有配置maven-compiler-plugin

需要在build中配置:

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
	<source>1.7</source>
	<target>1.7</target>
	<encoding>UTF-8</encoding>
	<compilerArguments>
		<extdirs>src/main/webapp/WEB-INF/lib</extdirs>
	</compilerArguments>
</configuration>
</plugin>

这样在启动项目的时候pom文件不单单回去你的本地仓库引出jar包,lib下的也会同时被引用到.

关于maven-compiler-plugin的配置自行百度,这里不做详细解释...

原创文章 25 获赞 5 访问量 2万+

猜你喜欢

转载自blog.csdn.net/weixin_41450959/article/details/88550542
今日推荐