[Maven] Missing artifact (解决办法)
在使用Eclipse的Maven插件时,经常会遇到Missing artifact的编译错误,特别是在新环境中搭建相关项目时,经常出现类似此问题,今天一位同事又遇到了,经过一顿问题原因查找,始终无法解决,决定来好好研究研究此类问题,以免以后遇到此类问题。
以下为尝试过的办法:
1. 项目右键->Maven->Update Dependency,失败
2. 项目右键->Maven->Disable Dependency, 然后再Enable Dependency,失败
3. 将Eclipse此类项目删除掉(不删除磁盘上的文件),重新导入,问题依旧,失败
4. 将相应项目从磁盘上删除,再从SVN重新下载下来,导入,问题依旧,失败
在经历了以上各种尝试之后,发现问题不在这些配置上,可能是某些地方冲突导致,不甘心的在网上搜索了一下,找到一篇解决办法:http://blog.csdn.net/mydeman/article/details/6126503
分析原因说是由于其中某个jar包导致,再仔细查看我打出的日志文件之后发现,跟文章中说明的很相似,而且我第一个报错的Jar包确实也没有pom文件,如下图:

其他正常的jar包:

所以问题原因就清楚了,按照前面的解决办法需要上传相应的pom文件至nexus上去,但是不能放到私服的Central里面,只能放到3rd party,里面,而我们的项目中引用的该文件又不能随意改动,因为引用的项目太多了,暂时还找不到更好的解决办法。
在这里找到貌似可以创建pom文件的办法:
http://stackoverflow.com/questions/4906017/maven-project-build-problems
文章中这样说:
Manually install each dependant jars using the
maven install:install-filecommand in the local repository. This will automatically create the poms for the jars and thus make it available to maven in subsequent runs.
使用maven install:install-file会自动创建poms,尝试这种办法之后,在项目目录下面执行此命令报错access is denied:
C:\career\tools\develop\svn\sources\v2.0\h2o\trunk\modules\utility>mvn install:i
nstall-file -DgroupId=opensymphony -DartifactId=quartz-all -Dversion=1.6.3 -Dpac
kaging=jar -Dfile=C:/career/tools/develop/maven/repositories/oecs-repository/rep
o/opensymphony/quartz-all/1.6.3
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for
com.orientpay:op-h2o-utility:jar:2.0.1-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-comp
iler-plugin is missing. @ line 1116, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten t
he stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support buildin
g such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building op-h2o-utility 2.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install-file (default-cli) @ op-h2o-utilit
y ---
[INFO] Installing C:\career\tools\develop\maven\repositories\oecs-repository\rep
o\opensymphony\quartz-all\1.6.3 to C:\career\tools\maven\repositories\oecs-repos
itory\repo\opensymphony\quartz-all\1.6.3\quartz-all-1.6.3.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.399s
[INFO] Finished at: Wed Aug 06 11:36:48 CST 2014
[INFO] Final Memory: 2M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.3
.1:install-file (default-cli) on project op-h2o-utility: Error installing artifa
ct 'opensymphony:quartz-all:jar': Failed to install artifact opensymphony:quartz
-all:jar:1.6.3: C:\career\tools\develop\maven\repositories\oecs-repository\repo\
opensymphony\quartz-all\1.6.3 (Access is denied) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
xception
C:\career\tools\develop\svn\sources\v2.0\h2o\trunk\modules\utility>
在网上搜索之后异常”access is denied“之后,修复该问题需要将本地仓库清空,再执行命令
根据上面的提示信息,可以在命令末尾添加-X: 在debug模式运行,而使用-e: 查看full stack错误信息,为了看到更加详细的信息,加上-X之后打印如下:
[DEBUG] (f) packaging = jar
[DEBUG] (f) repositoryLayout = default
[DEBUG] (f) updateReleaseInfo = false
[DEBUG] (f) version = 1.6.3
[DEBUG] -- end configuration --
[DEBUG] Installing generated POM
[INFO] Installing C:\career\tools\develop\maven\repositories\oecs-repository\rep
o\opensymphony\quartz-all\1.6.3 to C:\career\tools\maven\repositories\oecs-repos
itory\repo\opensymphony\quartz-all\1.6.3\quartz-all-1.6.3.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.938s
[INFO] Finished at: Wed Aug 06 12:07:56 CST 2014
[INFO] Final Memory: 2M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.3
.1:install-file (default-cli) on project op-h2o-utility: Error installing artifa
ct 'opensymphony:quartz-all:jar': Failed to install artifact opensymphony:quartz
-all:jar:1.6.3: C:\career\tools\develop\maven\repositories\oecs-repository\repo\
opensymphony\quartz-all\1.6.3 (Access is denied) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
rg.apache.maven.plugins:maven-install-plugin:2.3.1:install-file (default-cli) on
project op-h2o-utility: Error installing artifact 'opensymphony:quartz-all:jar'
: Failed to install artifact opensymphony:quartz-all:jar:1.6.3: C:\career\tools\
develop\maven\repositories\oecs-repository\repo\opensymphony\quartz-all\1.6.3 (A
ccess is denied)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:153)
由于不想删除本地仓库,只能待以后有机构再尝试了,现在就这样。
另外找到一个Quzrtz的demo样例,http://www.mkyong.com/java/quartz-scheduler-example/,里面给出的dependency是如下的,而不是我的配置文件中的quartz-all,这可能也是为什么在maven仓库里面下不到相关pom文件:
<dependency>
<groupId>opensymphony</groupId>
<artifactId>quartz</artifactId>
<version>1.6.3</version>
</dependency>
但是我们的pom文件是不能修改的
[Maven] Missing artifact (解决办法)的更多相关文章
- 针对Eclipse的maven Missing artifact com.microsoft.sqlserver:slqjdbc4:jar:4.0
maven 中添加sqlserver 出错,报错内容 maven Missing artifact com.microsoft.sqlserver 解决方法这里先下载好jar包 ,然后maven命令执 ...
- [Maven] Missing artifact
今天从朋友那拷过来一个maven工程,eclipse中maven配置好了,maven仓库也配置完毕,但是一直报Missing artifact,然后开网执行maven update,下载完jar后,还 ...
- Maven Missing artifact jar
maven error:Multiple annotations found at this line: - Missing artifact log4j:log4j:jar:1.2.15:compi ...
- 在Ubuntu14.04下安装运行Unity-tweak-tool报错scheme missing的解决办法
问题: 安装完unity-tweak-tool后,打开运行弹出出错窗口,忘了截图了,提示内容: scheme missing! Error: schema com.canonical.indicato ...
- maven Missing artifact com.sun:tools:jar:1.5.0
转自:http://blog.csdn.net/caolaosanahnu/article/details/7918929 http://zuoshahao.com/work/others/missi ...
- 解决maven项目找不到maven依赖的解决办法
不同的IDE对应的.classpath中的maven声明也不一样,这样就会导致项目找不到maven依赖. 即Java Build Path--->Libraries中找不到Maven Depen ...
- Error:Cause: org/gradle/api/publication/maven/internal/DefaultMavenFactory 解决办法
当你使用的Gradle版本是2.4以上,Android插件版本是1.3.0以上的时候就会出现这个问题,这时候你只需将android-maven-gradle-plugin插件版本改为classpath ...
- eclipse导入基于maven的java项目后没有Java标志和没有maven Dependencies有解决办法
没有java标志,不识别为Java项目,右键项目-->Properties-->Project Facets-->勾选Java 确定就可以了. 没有maven Dependenc ...
- 关于eclipse 项目导入不了 maven依赖的解决办法
1.首先确定你的项目是maven 项目 ,如果不是:项目右键Configure -->Convert to maven project. 2.在SVN导出的Maven项目,或以前不是用Maven ...
随机推荐
- Oauth 2.0第三方账号登录原理图
百度.QQ等服务商
- Lua简易入门教程
环境:lua for windows (lfW)主页:http://luaforwindows.luaforge.net/https://code.google.com/p/luaforwindows ...
- http://www.htmleaf.com/ziliaoku/qianduanjiaocheng/
http://www.htmleaf.com/ziliaoku/qianduanjiaocheng/ box-shadow : http://blog.csdn.net/freshlover/a ...
- c#.net Excel中的数据导入到SQL数据库中
/// <summary> /// 从Excel 导入学生 /// </summary> /// <param name=&qu ...
- POJ 1002
#include <stdio.h> #include <string.h> #include <stdlib.h> struct In{ int a; ]; }p ...
- sruts2 自定义类型转换器
1.1.1 Struts2中自定义类型转换器:(了解) 类型转换的过程是双向的过程: JSP---->Action参数提交:String---Date. Action---->JSP ...
- NGUI研究院之在Unity中使用贝塞尔曲线(六)[转]
鼎鼎大名的贝塞尔曲线相信大家都耳熟能详.这两天因为工作的原因需要将贝塞尔曲线加在工程中,那么MOMO迅速的研究了一下成果就分享给大家了哦.贝塞尔曲线的原理是由两个点构成的任意角度的曲线,这两个点一个是 ...
- Androidmanifest之manifest标签详细介绍
http://www.haogongju.net/art/2094337 文档下载
- Win7下打开计算机管理时出现错误的解决办法
计算机管理是用户在使用计算机时经常用到的一个选项,可以在桌面上右击计算机,选择"管理"打开.也可以在运行框中输入:compmgmt.msc打开计算机管理程序,里面有常用系统工具如用 ...
- 【XLL API 函数】xlStack
查看堆栈区还剩余多少空间 原型 Excel12(xlStack, LPXLOPER12 pxRes, 0); 参数 此函数没有带任何参数 属性值/返回值 返回堆栈区还剩余的字节数 备注 返回最新版本的 ...