Maven项目无法在本地存储库中找到依赖项

我有一个maven项目设置。

在我的maven POM文件中,它定义如下:

  4.0.0  com.myProject basePOM 1.0 ../../../shared/common/pom.xml  com.myProject.services orderservice developer war    org.apache.maven.plugins maven-resources-plugin 2.3  UTF-8        com.myProject.shared model   org.jboss.resteasy resteasy-jaxrs   org.jboss.resteasy resteasy-spring    

我有一个父POM定义了一些常见的位:

   4.0.0 Base POM com.myProject basePOM 1.0 pom    com.myProject.shared model developer   org.jboss.resteasy resteasy-jaxrs 1.2.GA   org.slf4j slf4j-simple     org.jboss.resteasy resteasy-spring 1.2.GA     

当我跑

 mvn clean install 

resteasy-jaxrs和resteasy-spring会毫无问题地下载到我的本地存储库。

然而,它然后产生一个错误说:

 **[ERROR] Failed to execute goal on project orderservice: Could not resolve dependencies for project com.mxyy.services:orderservice:war:developer: Failed to collect dependencies for [com.mxyy.shared:model:jar:developer (compile), org.jboss.resteasy:resteasy-jaxrs:jar:1.2. GA (compile), org.jboss.resteasy:resteasy-spring:jar:1.2.GA (compile), org.testng:testng:j ar:jdk15:5.8 (test)]: Failed to read artifact descriptor for com.mxyy.shared:model:jar:dev eloper: Failure to find com.mxyy:basePOM:pom:1.0 in http://repo.maven.apache.org/maven2 wa s cached in the local repository, resolution will not be reattempted until the update inte rval of central has elapsed or updates are forced -> [Help 1]** 

看起来项目无法获取本地存储库中已有的依赖项。

有人能让我知道如何解决这个问题吗?

非常感谢

更多信息:

我暂时删除了依赖项com.myProject.shared。 现在错误消息变为:

 [ERROR] Failed to execute goal on project orderservice: Could not resolve dependencies for project com.mxyy.services:orderservice:war:developer: Faile d to collect dependencies for [org.jboss.resteasy:resteasy-jaxrs:jar:1.2.GA (compile), org.jboss.resteasy:resteasy-spring:jar:1.2.GA (compile)]: Faile d to read artifact descriptor for org.scannotation:scannotation:jar:1.0.2: Could not transfer artifact org.scannotation:scannotation:pom:1.0.2 from/to jboss (http://repository.jboss.org/maven2): Access denied to: http://repository.jboss.org/maven2/org/scannotation/scannotation/1.0.2/scannotation-1.0 .2.pom, ReasonPhrase:Forbidden. -> [Help 1] 

好吧,看起来禁止访问。

您需要使用正确的 JBoss存储库路径: https : //repository.jboss.org/nexus/content/groups/public-jboss/

这是您需要的工件: https : //repository.jboss.org/nexus/content/groups/public-jboss/org/scannotation/scannotation/

那么,请在您的POM中提及:

   JBoss JBoss https://repository.jboss.org/nexus/content/groups/public-jboss/  

在存储库列表中

mvn clean install你的model项目。 这会将其工件安装到您的目标构建可以找到它们的本地仓库中。

编辑:

如果仍然没有帮助,请使用-X开关显示更多错误/调试信息:

 mvn -X clean install 

只看你的错误输出(我假设你没有手动输入),你似乎错误地将组ID从myProject输入到mxProject。

双重检查依赖声明(artifactId和groupId),它可能只是一个错字;)