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

匆匆过客 提交于 2019-12-04 09:00:19

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
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!