Question

I'm getting the following error in eclipse.

Archive for required library: '~/.m2/repository/org/hibernate/hibernate-core/4.2.1.Final/hibernate-core-4.2.1.Final.jar' in project

I've done Maven->Update Project and still it can't recognize the library.

I've verified that the jar file exists in the location mentioned. This post has the same error as I do but I double checked my pom and there are no duplicates.

Was it helpful?

Solution

Check access settings for file '~/.m2/repository/org/hibernate/hibernate-core/4.2.1.Final/hibernate-core-4.2.1.Final.jar' if you are using *nix system, Also make sure you can open hibernate-core-4.2.1.Final.jar archive using third party tools e.g. 7zip or winrar. from my experience many times maven in eclipse does not properly download dependency and downloaded jar is corrupted. If that is the case you can manually download this jar and replace it in .m2 repository.

OTHER TIPS

Try to run maven task eclipse:eclipse from command prompt

open command prompt, Change Directory to project root directory and type mvn eclipse:eclipse

And go back to eclipse and refresh project and see will it works :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top