Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse fix project setup by updating pom?

In an eclipse project, I referenced a class that was currently not in project's build path.

In the context sensitive pop-up that opens by hovering the mouse over the error, "Fix project setup" option has offered me to add a jar to the build path of the project. This jar is in my local maven repository.

However, the "correct" way to fix it is obviously by adding the relevant dependencies to my project's pom, instead of adding this jar to the build path of the project.

So is there a way to configure eclipse, so that it won't offer to add a maven repo jar to the build path, but it will offer to fix the project's pom?

like image 520
Utku Avatar asked Jun 30 '16 06:06

Utku


People also ask

How do I fix project setup in Eclipse?

Right-click on an error. Click on Quick Fix and search for the suggestion of importing a project or library.

How do I force a Maven project to update in Eclipse?

Update Maven settings in Eclipse. Right-click your project and select Maven Update Project and update your project.

What does Maven -> Update project do?

What does "Maven -> Update Project..." do in Eclipse? It just makes a refresh to reload the maven configuration file again.

How do I fix missing Maven dependencies in Eclipse?

My problem solved by right click on project -> Maven -> Update project. Then the Maven Dependencies appear on the project explore. Save this answer.


1 Answers

This feature used to exist in m2eclipse (the predecessor of m2e), see e.g. https://blog.sonatype.com/2010/03/adding-dependencies-using-m2eclipse/ which shows a "Search dependency for XXX" quickfix above the "Fix project setup..." quickfix.

Unfortunately it didn't make it into m2e, see https://www.eclipse.org/lists/m2e-users/msg01130.html

like image 176
Till Brychcy Avatar answered Sep 28 '22 14:09

Till Brychcy