2017年6月19日 星期一

[ Java 常見問題 ] Maven - How to load the dependencies from the pom into classpath of eclipse project?

Source From Here
Question
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.

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

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:


沒有留言:

張貼留言

[Git 常見問題] error: The following untracked working tree files would be overwritten by merge

  Source From  Here 方案1: // x -----删除忽略文件已经对 git 来说不识别的文件 // d -----删除未被添加到 git 的路径中的文件 // f -----强制运行 #   git clean -d -fx 方案2: 今天在服务器上  gi...