my dog learned polymorphism*
The moose likes Ant, Maven and Other Build Tools and the fly likes Missing artifact org.hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Missing artifact org.hibernate" Watch "Missing artifact org.hibernate" New topic
Author

Missing artifact org.hibernate

pramod talekar
Ranch Hand

Joined: Apr 26, 2010
Posts: 316

Hi ,

I am getting missing artifact 'org.hibernate:hibernate-annotations:jar:3.3.0.GA'



I installed it through command line :-

D:\J2EE\ragnarok-spring-hibernate>mvn install:install-file -Dfile=hibernate-commons-annotations-3.3.0.GA.jar -DgroupId=org.hibernate -DartifactId=hibernate-commons-annotations -Dversion=3.3.0.GA -Dpackaging=jar
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install-file (default-cli) @ standalone-pom ---
[INFO] Installing D:J2EE\ragnarok-spring-hibernate>mvn install:install-file -Dfile=hibernate-commons-annotations-3.3.0.GA.jar to C:\Documents and Settings\ptalek\.m2\repository\org\hibernate\hibernate-commons-annotations\3.3.0.GA\hibernate-commons-annotations-3.3.0.GA.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.375s
[INFO] Finished at: Tue Jan 24 16:40:36 IST 2012
[INFO] Final Memory: 2M/15M
[INFO] ------------------------------------------------------------------------

and restarted Eclipse , but POM shows the same error.
Also, this project has Spring project nature.

I changed the version from 3.3.0 to 3.2.1 in POM and it worked , so don't know why previous version is not working.

Please advise.


Thanks,
Pramod
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15950
    
  19

You shouldn't have to manually locally install that jar unless you're blocked from direct Internet access. Normally, Maven will check your local repository and install it from the remote Maven repo, if it isn't in the locale cache repo.

However, it appears that you have a mismatch on IDs. Your POM is asking for hibernate-annotations, but your install was instructed to file it under hibernate-commons-annotations.


Customer surveys are for companies who didn't pay proper attention to begin with.
pramod talekar
Ranch Hand

Joined: Apr 26, 2010
Posts: 316

Hey Tim,

I recreated my pom file & gave the below dependency. But I'm still getting the same error.



with this installation(though not necessary)

D:\J2EE\ragnarok-spring-hibernate>mvn install:install-file -Dfile=hibernate-commons-annotations-3.3.0.GA.jar -DgroupId=org.hibernate -DartifactId=hibernate-commons-annotations -Dversion=3.3.0.GA -Dpackaging=jar
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building ragnarok-spring-hibernate 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install-file (default-cli) @ ragnarok-spring-hibernate ---
[INFO] Installing D:\J2EE\ragnarok-spring-hibernate\hibernate-commons-annotations-3.3.0.GA.jar to C:\Documents and Settings\ptalek\.m2\repository\org\hibernate\hibernate-commons-annotations\3.3.0.GA\hibernate-commons-annotations-3.3.0.GA.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.889s
[INFO] Finished at: Tue Jan 24 19:27:03 IST 2012
[INFO] Final Memory: 2M/15M
[INFO] ------------------------------------------------------------------------

What could be the possible reason now.
My pom has got over 20 dependencies but I'm facing problem with only 2 including this one.
Please advise.


Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15950
    
  19

I think I found it.



Note the version. Some genius cataloged it with "ga" in lower case.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

Moral of this story: always check what is really stored in Maven Central (or whichever repo contains the artifact). A quick check at http://repo1.maven.org/maven2/org/hibernate/hibernate-annotations/ would have shown what versions are available.


JBoss In Action
pramod talekar
Ranch Hand

Joined: Apr 26, 2010
Posts: 316

I am back from the office now but I guess I had noticed the difference & tried out both ga & GA.
I also checked the dependencies for this particular artifact and had them inserted in my pom which worked fine.
Anyway, will let you know tomorrow.

Thanks a lot.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Missing artifact org.hibernate
 
Similar Threads
Could not resolve dependencies for maven project
Error Compiling Maven Project
Cannot locate the artifact jbossws-native-jaxrpc
Maven Dependency issue
Hibernate Jars Updation