gpt4 book ai didi

java - 构建 JBoss Hibernate 教程时遇到的问题

转载 作者:行者123 更新时间:2023-12-02 08:20:39 24 4
gpt4 key购买 nike

我听说过很多关于 hibernate 框架的好消息,所以我决定尝试一下。我已经从JBoss website下载了教程文件解压缩,但是当我尝试使用 mvn 编译命令构建项目时。

我收到构建错误(请参阅下面的 Maven 调试输出)。

我尝试清除子项目,但没有成功。 org.hibernate:hibernate-core:jar:3.6.2.Final 似乎有问题

有什么建议吗?

[INFO] Reactor Summary:
[INFO]
[INFO] Hibernate Getting Started Guide Tutorials ......... SUCCESS [0.025s]
[INFO] Hibernate hbm.xml Tutorial ........................ FAILURE [0.302s]
[INFO] Hibernate Annotations Tutorial .................... SKIPPED
[INFO] Hibernate JPA Tutorial ............................ SKIPPED
[INFO] Hibernate Envers Tutorial ......................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.561s
[INFO] Finished at: Sat Apr 02 23:32:43 PDT 2011
[INFO] Final Memory: 3M/247M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project hibernate-tutorial-hbm: Could not reso
lve dependencies for project org.hibernate.tutorials:hibernate-tutorial-hbm:jar:
3.6.2.Final: Failure to find org.hibernate:hibernate-core:jar:3.6.2.Final in htt
p://repo1.maven.org/maven2 was cached in the local repository, resolution will n
ot be reattempted until the update interval of central has elapsed or updates ar
e forced -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
n project hibernate-tutorial-hbm: Could not resolve dependencies for project org
.hibernate.tutorials:hibernate-tutorial-hbm:jar:3.6.2.Final: Failure to find org
.hibernate:hibernate-core:jar:3.6.2.Final in http://repo1.maven.org/maven2 was c
ached in the local repository, resolution will not be reattempted until the upda
te interval of central has elapsed or updates are forced
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDe
pendencies(LifecycleDependencyResolver.java:196)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resol
veProjectDependencies(LifecycleDependencyResolver.java:108)
at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAr
eResolved(MojoExecutor.java:258)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:201)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu
ild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
352)
Caused by: org.apache.maven.project.DependencyResolutionException: Could not res
olve dependencies for project org.hibernate.tutorials:hibernate-tutorial-hbm:jar
:3.6.2.Final: Failure to find org.hibernate:hibernate-core:jar:3.6.2.Final in ht
tp://repo1.maven.org/maven2 was cached in the local repository, resolution will
not be reattempted until the update interval of central has elapsed or updates a
re forced
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(D
efaultProjectDependenciesResolver.java:170)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDe
pendencies(LifecycleDependencyResolver.java:171)
... 22 more
Caused by: org.sonatype.aether.resolution.DependencyResolutionException: Failure
to find org.hibernate:hibernate-core:jar:3.6.2.Final in http://repo1.maven.org/
maven2 was cached in the local repository, resolution will not be reattempted un
til the update interval of central has elapsed or updates are forced
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDepe
ndencies(DefaultRepositorySystem.java:412)
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(D
efaultProjectDependenciesResolver.java:164)
... 23 more
Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Failure t
o find org.hibernate:hibernate-core:jar:3.6.2.Final in http://repo1.maven.org/ma
ven2 was cached in the local repository, resolution will not be reattempted unti
l the update interval of central has elapsed or updates are forced
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(Def
aultArtifactResolver.java:541)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArti
facts(DefaultArtifactResolver.java:220)
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDepe
ndencies(DefaultRepositorySystem.java:395)
... 24 more
Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Failure to fi
nd org.hibernate:hibernate-core:jar:3.6.2.Final in http://repo1.maven.org/maven2
was cached in the local repository, resolution will not be reattempted until th
e update interval of central has elapsed or updates are forced
at org.sonatype.aether.impl.internal.DefaultUpdateCheckManager.checkArti
fact(DefaultUpdateCheckManager.java:190)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(Def
aultArtifactResolver.java:430)
... 26 more
[ERROR]
[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 :hibernate-tutorial-hbm
C:\Program Files\Development\Tutorials\hibernate\jboss.org.hibernate.core>

最佳答案

该版本的 hibernate 不存在于中央 http://repo2.maven.org/maven2/org/hibernate/hibernate-core/

它确实存在于 JBoss 存储库中 https://repository.jboss.org/nexus/content/groups/public-jboss/org/hibernate/hibernate-core/

您需要添加https://repository.jboss.org/nexus/content/groups/public-jboss到您的存储库列表,以便在 POM 或主 Maven settings.xml 中进行搜索。

您可以将其添加到 POM 中,如 http://maven.apache.org/pom.html#Repositories 所示,或类似以下内容:

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
...
<repositories>
<repository>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
<id>jbosspublic</id>
<name>JBoss Public</name>
<url>https://repository.jboss.org/nexus/content/groups/public-jboss</url>
<layout>default</layout>
</repository>
</repositories>
<pluginRepositories>
...
</pluginRepositories>
...
</project>

关于java - 构建 JBoss Hibernate 教程时遇到的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5528064/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com