【发布时间】:2016-03-15 05:12:41
【问题描述】:
使用eclipse maven 和java 1.7 我设计了两个名为webservice.staff.backend 和 webservice.webuser.backend 的后端。
现在还有一个webservice,它是由我们的一些高级团队成员编写的,这是git与我分享的另一个Project模块。
在
pom.xml的这个新项目中,添加了两个本地项目依赖,如下所示。
<dependency>
<groupId>webservice.staff.backend</groupId>
<artifactId>webservice.staff.backend</artifactId>
<version>1.0.0</version>
<classifier>classes</classifier>
<type>jar</type> //used jar but webservices packaging as a war
</dependency>
<dependency>
<groupId>webservice.webuser.backend</groupId>
<artifactId>webservice.webuser.backend</artifactId>
<version>1.0.0</version>
<classifier>classes</classifier>
<type>jar</type> // used jar but webservices packaging as a war
</dependency>
但是当我只是尝试执行 Maven clean install 时,这些依赖关系并没有解决。我在之前的webservice 项目中发现的内容被打包为WAR,但这里用作jar
这里是
pom.xml中较早的项目打包类型。
<groupId>webservice.staff.backend</groupId>
<artifactId>webservice.staff.backend</artifactId>
<packaging>war</packaging> //packaged as war but used as jar??
<groupId>webservice.webuser.backend</groupId>
<artifactId>webservice.webuser.backend</artifactId>
<packaging>war</packaging> //packaged as war but used as jar in
/*I Have also Changed packaging as a jar and then clean Install
and try to build the New Project but error still the same. */
错误堆栈跟踪
[ERROR] Failed to execute goal on project webservice.credit.backend: Could not resolve dependencies for project webservice.credit.backend:webservice.credit.backend:war:2.0.0: The following artifacts could not be resolved: webservice.staff.webservice.staff.backend:jar:classes:1.0.0, webservice.webuser.backend:webservice.webuser.backend:jar:classes:1.0.0: Failure to find webservice.staff.backend:webservice.staff.backend:jar:classes:1.0.0 in http://download.java.net/maven/2/ was cached in the local repository, resolution will not be reattempted until the update interval of Java.Net has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
注意:- 在这方面,我在
stackOverflow上尝试了很多方法和很多答案,但没有人给我正确的解决方案。
请帮助任何人解决这个问题.. 谢谢。
【问题讨论】:
-
执行所有步骤并检查之后是否有任何问题:avajava.com/tutorials/lessons/…
-
谢谢,但我之前也试过@DipaliVasani
-
如您所见,2.0.0 版实际上是针对投资者后端而不是
staff和web-User后端。使用1.0.0为staff和web-user添加依赖关系 -
检查您的 settings.xml 中的
${user.home}/.m2/repository
标签: java eclipse web-services maven