错误的现场是下面这个样子:
[INFO] recharge-dal ...................................... SUCCESS [0.940s]
[INFO] recharge-service .................................. FAILURE [0.060s]
[INFO] recharge-front-web ................................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.110s
[INFO] Finished at: Tue Dec 04 14:57:23 CST 2012
[INFO] Final Memory: 8M/14M
[INFO] ------------------------------------------------------------------------
[ERROR]Failed to execute goal on project recharge-service: Could not resolve de
pendencies for project com.xxxxxx:recharge-service:jar:1.0.0-SNAPSHOT: Failure
to find com.xxxxxx:recharge-dal:jar:1.0.0-SNAPSHOT in http://192.168.xxx.xxx:8
081/nexus/content/groups/public/ was cached in the local repository, resolution
will not be reattempted until the update interval of maven-net has elapsed or up
dates are forced-> [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/DependencyReso
lutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :recharge-service
因为这个项目是三个独立项目依靠依赖关系结合在一起的recharge-front-web--> recharge-service -->recharge-dal。
这样的话就需要在web里包含其他两jar包。
从错误的意思上来说“找不到依赖的包com.xxxxxx:recharge-service:jar:1.0.0-SNAPSHOT和com.xxxxxx:recharge-dal:jar:1.0.0-SNAPSHOT"
之前也不知道怎么解决,然后问了前辈,在她的指点下找到了解决的方法,最终一切顺利。
具体的思路是这样的:因为错误提示是找不到依赖的包,所以就到相应的位置找相应的包。
首先进入mvn的repository目录,就是我们从服务器下载jar包存放的位置,
然后安装上面的那段路劲查找com-->xxxxxx-->recharge-service-->....1.0.0-SNAPSHOT.jar.lastUpdate
1.0.0-SNAPSHOT.jar.lastUpdate我们需要的是jar,结果看到的文件后面多了.lastUpdate,于是把多余的部分去掉。
最后再执行mvn eclipse:eclipse
结果前面的问题就解决了。
把这个问题写下来,希望能帮助到碰到和我一样问题的朋友们。
本来转载,用这个方法没问题,朋友们如果你用eclipse的插件编译没问题,可使用控制台有问题,大概是用的库不一样