Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you refresh maven dependencies from eclipse?

We recently started using maven for dependency management. Our team uses eclipse as it's IDE. Is there an easy way to get eclipse to refresh the maven dependencies without running mvn eclipse:eclipse?

The dependencies are up to date in the local maven repository, but eclipse doesn't pick up the changes until we use the eclipse:eclipse command. This regenerates a lot of eclipse configuration files.

like image 410
ScArcher2 Avatar asked Sep 25 '08 21:09

ScArcher2


People also ask

How do I force Maven to download dependencies in Eclipse?

Via the Maven index, you can search for dependencies, select them and add them to your pom file. To download the index, select Windows > Preferences > Maven and enable the Download repository index updates on startup option. After changing this setting, restart Eclipse. This triggers the download of the Maven index.


2 Answers

Have you tried using the m2eclipse plugin? I use it with eclipse and it maintains the eclipse .classpath when I add dependencies. It'll also check for updated dependencies.

like image 131
Joe Avatar answered Sep 19 '22 20:09

Joe


You generate the special eclipse files with mvn eclipse:eclipse, but once you've done that, you should let a plugin handle the dependencies while inside eclipse.

That's how we do it at my work place, and it generally works well.

like image 42
Chris Vest Avatar answered Sep 23 '22 20:09

Chris Vest