Update Project..." do in Eclipse?" /> Update Project..." do in Eclipse?" /> Update Project..." do in Eclipse?"/>

What does Maven Update Project do in Eclipse?

106.5k views Asked by At

What does "Maven -> Update Project..." do in Eclipse?

enter image description here

3

There are 3 answers

17
Gimby On BEST ANSWER

It syncs the Eclipse project settings with that of the pom. If you for example change important plugin settings, such as the output java version, you will find that Eclipse will ask you to update the project and afterwards the configured Java runtime in the project will have changed to reflect what your Maven pom indicates.

That is an important thing to keep in mind: the Maven pom is the lead in this kind of project setup. If you want settings to change, try to do that through the pom and not through Eclipse project settings directly or doing a project update might revert what you have changed. There are usually some things I have to correct myself anyway though, such as build path exclusions that m2eclipse likes to put in and strange deployment assembly configurations.

2
ddavison On

To add on to what @Gimby said - Update Project also provides more options such as Force Update of Snapshots / Releases which is extremely helpful when you have dependencies that are looking for the latest. (e.g.: [1.0) will find 1.0.* - whatever's the latest.)

Updating project is synonymous with Ivy's Resolve. It will make sure that all referenced dependencies are there, as well as clean the project to make sure that they are included correctly.

1
Witold Kaczurba On

I could not dig out the documentaiton, but I was able to dig out the code. To complement @Gimby answer - you can go into details and look into what the function does in here:

https://github.com/eclipse/m2e-core/blob/41f5ae34ad2543ef1439b7fd7e0a03b596af8685/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/project/ProjectConfigurationManager.java#L365

Look for : updateProjectConfiguration0 function.

Cheers,