尼玛 JB的Maven资源插件

11-11-6 上午09时56分52秒: Build errors for pc-client; org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.4.1:resources (default-resources) on project pc-client: Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.4.1:resources failed: Plugin org.apache.maven.plugins:maven-resources-plugin:2.4.1 or one of its dependencies could not be resolved: Missing:
----------
1) org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-4

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=org.codehaus.plexus -DartifactId=plexus-interactivity-api -Dversion=1.0-alpha-4 -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there:
      mvn deploy:deploy-file -DgroupId=org.codehaus.plexus -DartifactId=plexus-interactivity-api -Dversion=1.0-alpha-4 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency:
   1) org.apache.maven.plugins:maven-resources-plugin:maven-plugin:2.4.1
   2) org.apache.maven.shared:maven-filtering:jar:1.0-beta-3
   3) org.apache.maven:maven-core:jar:2.0.6
   4) org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-4

----------
1 required artifact is missing.

for artifact:
  org.apache.maven.plugins:maven-resources-plugin:maven-plugin:2.4.1

from the specified remote repositories:
  central (http://repo1.maven.org/maven2, releases=true, snapshots=false)

 

     今天电脑里装了myeclipse9.1,看里面自带maven插件,就把以前做的一个maven项目给布置进去了,尼玛,后台就打出了上述英文信息,似乎说maven读取资源信息插件安装没成功吧。运行项目,总是报空指针异常信息,至于项目中说空指针异常的信息也都是找不到文件路径。后台指向的错误地方,都是this.getClass().getClassLoader()
 .getResourceAsStream("images/add.PNG")此类地方。

     依本人看,估计确实是maven插件有问题,或者说myeclipse9.1中自带的maven插件不是完全的,没有查找资源文件路径信息的插件吧。不过我测试了一下,不用maven项目,直接一个普通的java项目中,this.getClass().getClassLoader().getResourceAsStream("images/add.PNG")都能够读取到相关的路径文件,那就算maven插件有问题,应该也不会造成读取不到路径下面的文件啊,在此我有些想不通。

     现本想能不能重新安装一下maven插件,不使用9.1中自带的maven插件,找了个apache-maven-3.0.3版本的,配置了一下环境变量,在cmd命令行中敲入mvn -version也有了相关的信息。然后选择“window”->"preferences"->“MyEclipse”->"Maven4MyEclipse"->"Maven"->"Installations",此时在右端有个列表,列表右边有“Add”、“Edit”等三个按钮,选择“Add”,然后选择自己的maven的根目录,选择完后就点击“Apply”和“ok”。这一切搞定后,可是只要我引入之前的项目后台就老是输出上述英文信息,而新建一个新的maven项目也有此英文信息,可以肯定的不是我代码的问题

     以上问题的解决办法,还望能有高手指点,在下感激不尽!

 

进行了如下操作,似乎还是没有用

 

Microsoft Windows XP [版本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.

C:\Documents and Settings\Administrator>mvn install:install-file -DgroupId=org.c
odehaus.plexus -DartifactId=plexus-interactivity-api -Dversion=1.0-alpha-4 -Dpac
kaging=jar -Dfile=/path/to/file
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install-file (default-cli) @ standalone-po
m ---
[INFO] Installing C:\path\to\file to C:\Documents and Settings\Administrator\.m2
\repository\org\codehaus\plexus\plexus-interactivity-api\1.0-alpha-4\plexus-inte
ractivity-api-1.0-alpha-4.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.984s
[INFO] Finished at: Mon Dec 05 19:00:49 CST 2011
[INFO] Final Memory: 2M/15M
[INFO] ------------------------------------------------------------------------
C:\Documents and Settings\Administrator>mvn install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.219s
[INFO] Finished at: Mon Dec 05 19:01:13 CST 2011
[INFO] Final Memory: 1M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM
 in this directory (C:\Documents and Settings\Administrator). Please verify you
invoked Maven from the correct directory. -> [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/MissingProject
Exception

C:\Documents and Settings\Administrator>mvn deploy:deploy-file -DgroupId=org.cod
ehaus.plexus -DartifactId=plexus-interactivity-api -Dversion=1.0-alpha-4 -Dpacka
ging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-deploy-plugin:2.5:deploy-file (default-cli) @ standalone-pom --
-
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.938s
[INFO] Finished at: Mon Dec 05 19:36:34 CST 2011
[INFO] Final Memory: 2M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.5:
deploy-file (default-cli) on project standalone-pom: C:\path\to\file not found.
-> [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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值