Maven使用过程中出现的问题汇总

1.执行mvn install命令时,提示Fatal error compiling: tools.jar not found: C:\Develop\Java\jre6\..\lib\tools.jar -> [Help 1]

情景:将项目部署到Tomcat时,提示找不到关联项目中的某个类,考虑可能是关联项目没有构建成功,因此在Eclipse中使用Run as->maven install对关联项目执行mvn install命令,接着提示错误:Fatal error compiling: tools.jar not found: C:\Develop\Java\jre6\..\lib\tools.jar -> [Help 1]

原因:在Eclipse的Installed JREs配置中,我将JRE home指定为jre的路径,而这个路径中不包含lib\tools.jar这个文件。

解决办法:置Installed JREs时,JRE home应该指定jdk的路径


2.Maven新建项目或导入Maven项目时出错

出错提示如下:

Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5 
Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5

出现Could not calculate build plan: 这种错误,只要到你的Maven本地库中把对应的文件夹(如本文中:%Local_Respority%/org.apache.maven/plugins/maven-resources-plugin)删除,让Maven再重新下载这个依赖就可以解决了。



3.解决Maven报Plugin execution not covered by lifecycle configuration

出错提示如下:

    Plugin execution not covered by lifecycle configuration:

解决方法:

 在<plugins> 标签外再套一个 <pluginManagement> 标签,即可。

也可参考:

http://blog.csdn.net/xxd851116/article/details/25197373



你可能感兴趣的:(Maven使用过程中出现的问题汇总)