Problems building the JBoss Hibernate tutorial
I have heard a lot of good things about the hibernate frame work, so i decided to try it out. I have downloaded the tutorial files from JBoss website unzipped but when i am trying to build the project using the mvn compile command.
i am getting build errors (see below the maven debug output).
I have tried to purge the subprojects but it didnt work. it seem like there is a problem with the org.hibernate:hibernate-core:jar:3.6.2.Final
Any advice??
[INFO] Reactor Summary:
[INFO]
[INFO] Hibernate Getting Started Guide Tutorials ......... SUCCESS [0.0开发者_如何学JAVA25s]
[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>
That version of hibernate does not exist in central at http://repo2.maven.org/maven2/org/hibernate/hibernate-core/
It does exist in the JBoss repo at https://repository.jboss.org/nexus/content/groups/public-jboss/org/hibernate/hibernate-core/
You need to add https://repository.jboss.org/nexus/content/groups/public-jboss to your list of repositories to search in either your POM or in your master Maven settings.xml.
You can add this to your POM as shown at http://maven.apache.org/pom.html#Repositories, or something like the following:
<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>
精彩评论