maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Teody Cue Jr." <t...@exist.com>
Subject Re: Maven & hibernate, dependencies not working,plz help :)
Date Fri, 20 Jul 2007 01:51:51 GMT
Hi Pinky,

You need to install hibernate and hsqldb artifacts in your local 
repository. Install the jars that you have downloaded using the commands 
provided by maven when you run mvn eclipse:eclipse.

mvn install:install-file -DgroupId=hibernate -DartifactId=hibernate -Dversion=3.2.4.spl -Dpackaging=jar
-Dfile=/path/to/file
mvn install:install-file -DgroupId=hsqldb -DartifactId=hsqldb -Dversion=1.8.0.6 -Dpackaging=jar
-Dfile=/path/to/file


Where /path/to/file points to the jar files you've downloaded and 
unzipped. :)
You need this because maven looks for the jars(or artifacts in maven 
world) in your local repository(/home/karon/.m2/repository). Issuing the 
commands will insure that those jars are placed in your local repository 
and in the right directories(groupId/artifactId/version).

Hope this helps!

Teody



pinky88 wrote:
> Hi everyone,
>
> I'm a beginner to maven and hibernate, and i'm trying to build up a small
> project as a tutorial using maven.
> I'm using hibernate and hsqldb also.
> Using examples I've found on the net, I've added dependencies for both
> hibernate and hsqldb, so my pom.xml looks like this:
>
> <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/maven-v4_0_0.xsd">
>   <modelVersion>4.0.0</modelVersion>
>   <groupId>de.groegl.road2hibernate</groupId>
>   <artifactId>HibernateTutorial</artifactId>
>   <packaging>jar</packaging>
>   <version>1.0-SNAPSHOT</version>
>   <name>HibernateTutorial</name>
>   <url>http://maven.apache.org</url>
>   <dependencies>
>     <dependency>
>       <groupId>junit</groupId>
>       <artifactId>junit</artifactId>
>       <version>3.8.1</version>
>       <scope>test</scope>
>     </dependency>
>     <dependency>
>       <groupId>hsqldb</groupId>
>       <artifactId>hsqldb</artifactId>
>       <version>1.8.0.6</version>
>     </dependency>
>     <dependency>
>       <groupId>hibernate</groupId>
>       <artifactId>hibernate</artifactId>
>       <version>3.2.4.spl</version>
>       <scope>compile</scope>
>     </dependency> 
>   </dependencies>
> </project>
>
> The versions are correct and i have both hibernate and hsqldb downloaded and
> unzipped..
>
>  When i run mvn eclipse:eclipse i get the following :
>
> [INFO] Scanning for projects...
> [INFO] Searching repository for plugin with prefix: 'eclipse'.
> [INFO]
> ----------------------------------------------------------------------------
> [INFO] Building HibernateTutorial
> [INFO]    task-segment: [eclipse:eclipse]
> [INFO]
> ----------------------------------------------------------------------------
> [INFO] Preparing eclipse:eclipse
> [INFO] No goals needed for project - skipping
> [INFO] [eclipse:eclipse]
> Downloading:
> http://repo1.maven.org/maven2/hibernate/hibernate/3.2.4.spl/hibernate-3.2.4.spl.pom
> Downloading:
> http://repo1.maven.org/maven2/hsqldb/hsqldb/1.8.0.6/hsqldb-1.8.0.6.pom
> Downloading:
> http://repo1.maven.org/maven2/hibernate/hibernate/3.2.4.spl/hibernate-3.2.4.spl.jar
> [WARNING] An error occurred during dependency resolution.
>     Failed to retrieve hibernate:hibernate-3.2.4.spl
> Caused by: Unable to download the artifact from any repository
>
> Try downloading the file manually from the project website.
>
> Then, install it using the command: 
>     mvn install:install-file -DgroupId=hibernate -DartifactId=hibernate \
>         -Dversion=3.2.4.spl -Dpackaging=jar -Dfile=/path/to/file
> Alternatively, if you host your own repository you can deploy the file
> there:     mvn deploy:deploy-file -DgroupId=hibernate -DartifactId=hibernate
> \
>         -Dversion=3.2.4.spl -Dpackaging=jar -Dfile=/path/to/file \
>          -Durl=[url] -DrepositoryId=[id]
>
> Path to dependency: 
>         1) de.groegl.road2hibernate:HibernateTutorial:jar:1.0-SNAPSHOT
>         2) hibernate:hibernate:jar:3.2.4.spl
>
>
>   hibernate:hibernate:jar:3.2.4.spl
>
> from the specified remote repositories:
>   central (http://repo1.maven.org/maven2)
>
> [INFO] Unable to read jar manifest from
> /home/karen/.m2/repository/hibernate/hibernate/3.2.4.spl/hibernate-3.2.4.spl.jar
> Downloading:
> http://repo1.maven.org/maven2/hsqldb/hsqldb/1.8.0.6/hsqldb-1.8.0.6.jar
> [WARNING] An error occurred during dependency resolution.
>     Failed to retrieve hsqldb:hsqldb-1.8.0.6
> Caused by: Unable to download the artifact from any repository
>
> Try downloading the file manually from the project website.
>
> Then, install it using the command: 
>     mvn install:install-file -DgroupId=hsqldb -DartifactId=hsqldb \
>         -Dversion=1.8.0.6 -Dpackaging=jar -Dfile=/path/to/file
> Alternatively, if you host your own repository you can deploy the file
> there:     mvn deploy:deploy-file -DgroupId=hsqldb -DartifactId=hsqldb \
>         -Dversion=1.8.0.6 -Dpackaging=jar -Dfile=/path/to/file \
>          -Durl=[url] -DrepositoryId=[id]
>
> Path to dependency: 
>         1) de.groegl.road2hibernate:HibernateTutorial:jar:1.0-SNAPSHOT
>         2) hsqldb:hsqldb:jar:1.8.0.6
>
>
>   hsqldb:hsqldb:jar:1.8.0.6
>
> from the specified remote repositories:
>   central (http://repo1.maven.org/maven2)
>
> [INFO] Unable to read jar manifest from
> /home/karen/.m2/repository/hsqldb/hsqldb/1.8.0.6/hsqldb-1.8.0.6.jar
> [INFO] Using source status cache:
> /home/karen/development/workspace/HibernateTutorial/target/mvn-eclipse-cache.properties
> [INFO] Not writing settings - defaults suffice
> [INFO] File /home/karen/development/workspace/HibernateTutorial/.project
> already exists.
>        Additional settings will be preserved, run mvn eclipse:clean if you
> want old settings to be removed.
> [INFO] Wrote Eclipse project for "HibernateTutorial" to
> /home/karen/development/workspace/HibernateTutorial.
> [INFO] 
>        Sources for some artifacts are not available.
>        Please run the same goal with the -DdownloadSources=true parameter in
> order to check remote repositories for sources.
>        List of artifacts without a source archive:
>          o junit:junit:3.8.1
>          o hibernate:hibernate:3.2.4.spl
>          o hsqldb:hsqldb:1.8.0.6
>
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESSFUL
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 2 seconds
> [INFO] Finished at: Fri Jul 20 01:24:25 IST 2007
> [INFO] Final Memory: 3M/7M
> [INFO]
> ------------------------------------------------------------------------
>
>
> Although it says build successful it is telling me it could not find
> hibernate or hsqldb jars.. I have no idea why.
>
> I'm new to all of this, maybe I have to have things in specific directories
> or something?
>
> Hope someone can help =) thanks in advance!
> Pinky :)
>   

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Mime
View raw message