访问被拒绝http://repository.jboss.com/maven2/

Gma*_*yem -2 jboss annotations hibernate maven

我试图将hibernate注释添加到我的Maven项目中,但是我遇到了以下错误:

  • ArtifactDescriptorException:无法读取hibernate-commons-annotations的工件描述符:hibernate-commons-annotations:jar:3.0.0.GA:ArtifactResolutionException:无法传输hibernate-commons-annotations:hibernate-commons-annotations:pom:3.0.0来自http:// repository.jboss.com/maven2/的.GA缓存在本地存储库中,在JBoss存储库的更新间隔过去或强制更新之前,不会重新尝试解析.原始错误:无法传输工件hibernate-> commons-annotations:hibernate-commons-annotations:pom:3.0.0.GA from/to JBoss repository(http://repository.jboss.com/maven2/):访问被拒绝> http://repository.jboss.com/maven2/hibernate-commons-annotations/hibernate- commons-annotations/3.0.0.GA/hibernate-commons-annotations-3.0.0.GA.pom.错误>代码403,
    • ArtifactDescriptorException:无法读取hibernate-> annotations的工件描述符:hibernate-annotations:jar:3.3.0.GA:ArtifactResolutionException:无法传输hibernate-annotations:hibernate-> annotations:pom:3.3.0.GA from http:/ /repository.jboss.com/maven2/缓存在本地存储库中,在JBoss存储库的更新间隔过去或强制更新之前,不会重新尝试解析.原始错误:无法传输工件hibernate-annotations:hibernate-> annotations:pom:3.3.0.GA from/to JBoss repository(http://repository.jboss.com/ maven2 /):拒绝访问http:// repository.jboss.com/maven2/hibernate- > annotations/hibernate-annotations/3.3.0.GA/hibernate- annotations-3.3.0.GA.pom.错误代码403,禁止

我用这个代码

<repository>
  <id>JBoss repository</id>
  <url>http://repository.jboss.com/maven2/</url>
</repository>
Run Code Online (Sandbox Code Playgroud)

和

<!-- Hibernate annotation -->
<dependency>
    <groupId>hibernate-annotations</groupId>
    <artifactId>hibernate-annotations</artifactId>
    <version>3.3.0.GA</version>
</dependency>

<dependency>
    <groupId>hibernate-commons-annotations</groupId>
    <artifactId>hibernate-commons-annotations</artifactId>
    <version>3.0.0.GA</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)

Gui*_*sta 6

根据JBoss Maven Repositories的描述, http://repository.jboss.com/maven2/已经弃用并且应该被替换http://repository.jboss.org/nexus/content/groups/public/.

您可以阅读开发人员应如何配置Maven以使用JBoss存储库.

所以在你的POM中使用:

<repositories>
  <repository>
    <id>jboss-public-repository-group</id>
    <name>JBoss Public Repository Group</name>
    <url>http://repository.jboss.org/nexus/content/groups/public/</url>
  </repository>
</repositories>
Run Code Online (Sandbox Code Playgroud)

对于hibernate-annotations:hibernate-annotations:3.3.0.GA依赖项,使用Maven Central存储库无济于事,因为它不是由它托管的.但它是由JBoss的库中托管的JBoss已过时.
但是你会在Maven Central找到它(改名)org.hibernate:hibernate-annotations:3.3.0.ga.

如果您确实想使用已弃用的存储库:

<repositories>
  <repository>
    <id>jboss-deprecated</id>
    <name>JBoss Deprecated</name>
    <url>https://repository.jboss.org/nexus/content/repositories/deprecated/</url>
  </repository>
</repositories>
Run Code Online (Sandbox Code Playgroud)

不同的JBoss Maven资源库/组的解释存在.

也可以看看 :

关于JBoss,已弃用的groupIds(如hibernate-annotations)在那里发布.