Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to load the dependencies from the pom into classpath of eclipse project?

Am using eclipse helios with m2eclipse plugin. For a maven project checked out from CVS, how do i tell eclipse to automatically fetch all the jars needed for that project from the dependencies mentioned in the pom.

Thanks for your time

like image 842
Rajan Avatar asked May 20 '11 13:05

Rajan


1 Answers

m2eclipse should do this for you (dependencies will be copied to your local repository) and build a valid classpath. I you have any doubts that the resolved dependencies are outdated try

<select project> -> Context Menu -> Maven -> Update Dependencies

If you want to guarantee that all dependencies (and plugins) are in your local repository you can run the go-offline goal from the Maven Dependency Plugin:

mvn dependency:go-offline

If you want to copy all needed dependencies to one place, use the copy-dependencies goal

mvn dependency:copy-dependencies

The Maven Dependency Plugin will copy all dependencies (including transitive) to the target/dependency folder in this case.

You can run all these commands also from eclipse using:

<select project> -> Context Menu -> Run As -> Maven build... -> <type goals> -> Run
like image 137
FrVaBe Avatar answered Sep 22 '22 18:09

FrVaBe