-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Newbie Q: Install Guidance?
PostPosted: Mon Jul 22, 2013 11:23 pm 
Newbie

Joined: Mon Jul 22, 2013 11:00 pm
Posts: 1
Location: Philadelphia PA USA
I am working with the Hibernate Tutorial http://docs.jboss.org/hibernate/orm/3.3/reference/en-US/html/tutorial.html

I have Maven 3.0.3 and Java 1.6.0_51 installed and I'm running on a Mac OSX with Mountain Lion.

I have entered the POM.XML shown in SETUP and am working through the errors. I added appropriate <version> tags for each dependency, but it seems not to be able to find my download of the hibernate-core components. I have tried using mvn install:

mvn install:install-file -DgroupId=org.hibernate -DartifactId=hibernate-core -Dversion=4.2.3.Final -Dpackaging=jar -Dfile=./required/hibernate-core-4.2.3.Final.jar

But I still get a complaint that it can't find hibernate-core. I'm thinking that I need to do some sort of master install of hibernate and hibernate tools before any of this will work, but I haven't figured out what exactly to do from the tutorial.

Here's my current POM.XML after tracking down some of the stuff it seemed to need (yes, I tried using exactly what was given in the tutorial too):

Code:
<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">

  <modelVersion>4.0.0</modelVersion>

  <groupId>org.hibernate.tutorials</groupId>
  <artifactId>hibernate-tutorial</artifactId>
  <version>1.0.0-SNAPSHOT</version>
  <name>First Hibernate Tutorial</name>

  <build>
    <!-- avoid having version included in final name -->
    <finalName>${artifactId}</finalName>
  </build>
 
  <dependencies>
    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-core</artifactId>
      <version>4.2.3</version>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <version>3.1.0</version>
    </dependency>
    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-tools</artifactId>
      <version>4.0.0</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j</artifactId>
      <version>1.7.5</version>
    </dependency>
    <dependency>
      <groupId>org.javassist</groupId>
      <artifactId>javassist</artifactId>
      <version>3.18.0-GA</version>
    </dependency>
  </dependencies>

</project>


And here's the output I'm getting from mvn compile:
Code:
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.hibernate.tutorials:hibernate-tutorial:jar:1.0.0-SNAPSHOT
[WARNING] The expression ${artifactId} is deprecated. Please use ${project.artifactId} instead.
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building First Hibernate Tutorial 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.hibernate:hibernate-core:jar:4.2.3 is missing, no dependency information available
[WARNING] The POM for org.slf4j:slf4j:jar:1.7.5 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.246s
[INFO] Finished at: Mon Jul 22 23:20:40 EDT 2013
[INFO] Final Memory: 2M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project hibernate-tutorial: Could not resolve dependencies for project org.hibernate.tutorials:hibernate-tutorial:jar:1.0.0-SNAPSHOT: The following artifacts could not be resolved: org.hibernate:hibernate-core:jar:4.2.3, javax.servlet:servlet-api:jar:3.1.0, org.slf4j:slf4j:jar:1.7.5: Failure to find org.hibernate:hibernate-core:jar:4.2.3 in http://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 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.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException


Any suggestions would be appreciated. Thanks.


Top
 Profile  
 
 Post subject: Re: Newbie Q: Install Guidance?
PostPosted: Sun Jul 28, 2013 8:05 am 
Newbie

Joined: Fri Jul 26, 2013 8:04 am
Posts: 2
Hi Sloughin and welcome to Hibernate.

After you download the distribution package of Hibernate, you need to copy all the "jars" from "<install-lib>/lib/required" folder.
There is also a nice tutorial in: "http://ejbas-hibernate.blogspot.co.il/", that explains how to use Hibernate in a really neat and detailed step-by-step.

Good luck


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.