Maven使用过程中遇到的问题及解决方案
来源:互联网 发布:万网域名过户 编辑:程序博客网 时间:2024/04/29 22:22
图片上传有点问题,请参考附件
一、Maven错误的解决方案
问题:Could not transfer artifact org.codehaus.plexus:plexus-archiver:jar:1.2 from/to central
(http://repo.maven.apache.org/maven2): connection timed
out to http://211.136.8.21/files/41970000008EDF53/repo1.maven.org/
maven2/org/codehaus/plexus/plexus-archiver/1.2/plexus-archiver-1.2.jar
详细解决方案请访问:
http://www.bubuko.com/infodetail-914917.html
解决方法:
1)plexus-archiver-1.2.jar下载放在本地maven仓库中,下载地址为:http://www.java2s.com/Code/Jar/p/Downloadplexusarchiver12jar.htm
仓库位置如下:
2)alt+F5刷新项目,问题就消失了
二、Maven工程中The parent project must have a packaging type of POM
解决方法:修改父项目的packaging类型为POM
2、我在Eclipse中新建Static web project 后,发觉没有source folder文件夹,于是想自己手工添加一个src的source folder文件夹,结果出现:Project is not a Java project的错误
解决方法:更改工程的Project Facets,详细做法如下图所示:
点击Apply
三、在Maven工程中引用第三方类库的函数或注解时,没有导包提示,如图3-1所示:
图 3-1 错误图
错误原因:Maven工程没有成功“Maven install”
解决方法:右击工程“Run As/Maven install”,如图3-2所示
图 3-2 解决方法图
四、Maven工程中出现以下错误:“artifactId is missing @line 3,@column100”,访问https://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException可知可能的原因如下:
1. A POM can't be parsed because its XML is not well-formed or contains invalid elements, see alsoModelParseException.
2. A parent POM can't be resolved, e.g. because the POM is neither present locally at the path denoted by <relativePath> nor available in any of the <repositories> declared in the POM or the settings.xml, see alsoUnresolvableModelException.
3. The contents of a POM is incomplete or otherwise semantically invalid.
4. A child module of an aggregator project could not be found at the specified location.
经过检查后,我发现我的项目pom.xml中出现拼写错误,错误展示如下:
图 4-1 错误显示
properties用于定义属性,不能把modelVersion等包起来,正确的做法如下:
图 4-2 解决方法
- Maven使用过程中遇到的问题及解决方案
- MAVEN环境搭建中遇到的问题及解决方案
- 使用easyui过程中遇到的问题及解决方案积累中...
- 装Windows 8 过程中遇到的问题,及解决方案
- snort安装过程中遇到的问题及解决方案
- Oracle安装过程中遇到的一些问题及解决方案
- c++开发过程中遇到的问题及解决方案
- android 开发过程中遇到的问题及解决方案
- hbase测试过程中遇到的一些问题及解决方案
- 登录Oracle过程中遇到的问题及解决方案
- TensorFlow编译过程中遇到的问题及解决方案
- 记录网页制作过程中遇到的问题及解决方案
- Eclipse使用过程遇到问题及解决方案
- ADS1.2环境使用过程中遇到的问题及解决方案
- Android Studio使用过程中遇到的一些问题及解决方案
- Android Studio使用过程中遇到的一些问题及解决方案
- Android Studio使用过程中遇到的一些问题及解决方案
- MyEclipse使用过程中遇到的问题和解决方案
- leetcode_c++:Roman to Integer(013)
- SpringMVC项目中常见问题以及解决方案
- Filter的用法
- hdu 2588
- iOS 数据持久化存储
- Maven使用过程中遇到的问题及解决方案
- Linux 开放指定服务端口
- HDOJ -- 1596 find the safest road
- 《牛客面试算法题精讲第二季》专题3
- windows下多线程学习笔记3--ffmpeg两路视频解码
- hdu5795 博弈
- Qt应用远程连接SQL Server
- 数据结构 - 顺序表
- oracle-行转列点评oracle11g sql新功能pivot/unpivot