Maven遇到的错误汇总

创建Maven项目出错,

1.项目名带有Maven Webapp

解决方案:



2.缺少jar包

could not resolve archetype

    原因:本地库中缺少 maven-archetype-quickstart插件或者插件

  解决方案:

    1.百度下载:maven-archetype-quickstart-1.1.jar,  放在maven安装目录lib下,例如:D:\apache-maven-3.3.9\lib

    2.cmd窗口执行命令(进入jar包所在路径下):

    mvn install:install-file -DgroupId=org.apache.maven.archetypes -DartifactId=maven-archetype-quickstart -Dversion=1.1 -Dpackaging=jar -Dfile=maven-archetype-quickstart-1.1.jar

 

 参考:http://www.th7.cn/Program/java/201502/386237.shtml



3.连不上中央库

could not calculate build plan

  原因:http://repo1.maven.org/maven2这个中央仓库地址已经被屏蔽了,不能访问,所以maven用到的插件和jar下载失败,且你的电脑上的本地仓库,并没有下载好maven的插件等

  解决方案:

    1.把‘另外电脑中‘的本地仓库.m2目录拷贝到你的电脑上,并在maven conf settings.xml里面设置<localRepository>为.m2目录。

    2.有私服(例如nexus),就在settings.xml里面配置nexus地址,从它上面下载。



4.新建的项目,pom文件上红X:

Failure to transfer org.apache.maven:maven-artifact:pom:2.0.6 from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven:maven-artifact:pom:2.0.6 from/to central (http://repo.maven.apache.org/maven2): No connector available to access repository central (http://repo.maven.apache.org/maven2) of type default using the available factories pom.xml /hello line 1 Maven Configuration Problem

1.

打开Window-->preferences-->myeclipse-->maven4myeclipse--->user settings把local repository里面的地址复制。

  1. 如果你的myeclipse没有的话,就找到:

    c:\users\{你的电脑账号}\.m2\repository (一般在这个文件夹里)。

    比如我的:c:\users\long\.m2\repository

  2.  

    找打repository文件及后,在里面搜索 maven*.lastupdated。把搜出来的文件都删了。

  3.  

    重启myeclipse,右键项目--->maven4myeclipse--->update project...

  4.  

    勾选Force Update of Snapshots/Releases,然后ok退出,如果还是错误,不要着急,先等一会。



2.部署maven项目出错

1.jdk编译出错

Unsupported major.minor version 51.0

原因:编译源码的jdk 和 tomcat 使用的jdk版本不一样

解决:项目------>右键------>properties------>Java Compiler------>Compiler Compliance Level------>选择你使用的JDK版本

时间: 2024-08-02 07:45:58

Maven遇到的错误汇总的相关文章

maven项目开发错误汇总

Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean) on project sharp-fridge-common: Failed to clean project: Failed to delete D:\Sharp_prototype\sharp_fridge\Trunk\sharp-fridge\sharp-slc-common\target\sharp-fr

1.Maven+SpringMVC+Eclipse软件安装配置,Maven报插件错误,Eclipse总是卡死的解决办法,导入一个maven工程后 一直显示importing maven project

 使用Maven+SpringMVC+Eclipse软件安装配置过程中的问题: 1.Eclipse总是卡死的解决办法: 一:内存不足所以会卡死,配置一下eclipse.ini修改这几个值就好了-XX:MaxPermSize=768m-Xms1024m-Xmx3072m搜索 二:修改window->preferences --- > JAVA->Edittor->Hovers,将右侧所有复选框清空. 2.因为eclipse上一次未正常关闭,导致启动卡死,错误日志为: [plain

Git各种错误汇总

1.github上版本和本地上版本冲突的方法,即提交时会提示如下错误: 解决方法,提交时采用如下代码: git push -u origin master -f 参考链接: http://blog.csdn.net/shiren1118/article/details/7761203 Git各种错误汇总

李洪强iOS开发之OC常见错误汇总

// //  main.m //  16 - 常见错误汇总 // //  Created by vic fan on 16/7/13. //  Copyright © 2016年 李洪强. All rights reserved. // OC的常见错误汇总: 1 @interface ... @end  和 @implementation ..@end 之间不能嵌套 2只有类的声明没有类的实现 3 漏写@end 4 两个类的声明顺序可以打乱,但是类的声明一定要在类的实现前面 5 成员变量没有放在

解决maven项目 maven install失败 错误 Failed to execute goal org.apache.maven.plugins

1.Maven构建失败 Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin: 2.3.4 :compile ( default -compile) on project oecp: Compilation failure 2.解决方法:使用自己的jdk,记住是jdk,因为jdk里本身包含jre.而不是单纯的jre.本人初学者,表达肤浅,请看勿笑. 解决maven项目 maven install失败 错误 Fa

Eclipse导入Maven项目出现错误:Unsupported IClasspathEntry kind=4

使用Eclipse导入Maven项目失败,提示: An internal error occurred during: "Importing Maven projects". Unsupported IClasspathEntry kind=4 修复这个问题需要做两件事 1.保证m2e插件的版本高于 1.1.0,如果没有则到站点升级 : https://repository.sonatype.org/content/repositories/forge-sites/m2e/1.1.0/

ibatis错误汇总

1) 错误:The prefix "context" for element "context:property-placeholder" is not bound. 解决:在文件头中引入:xmlns:context="http://www.springframework.org/schema/context" 即可. 正解例子: <beans xmlns="http://www.springframework.org/schem

C#新手常犯的错误汇总

本文所述为C#新手常犯的错误,但是实际上很多有经验的程序员也经常犯这些错误,对此特别整理了一下,供大家参考.具体如下: 1.遍历List的错误 ,比如如下代码: List<String> strList =newList<String> for(int i =0; i<strList.Count; i++) { strList.RemoveAt(i); } 这段代码看上去是删除了所有元素,实际上每次调用RemoveAt方法会导致List元素索引重排,最后导致元素没有完全删除.

Linux错误汇总

Linux错误汇总 一,Linux系统下安装完MySQL,启动MySQL报错:Neither host 'localhost.localdomain' nor 'localhost' could be looked up with... [[email protected]ost ~]# mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'