First of all, I am aware of this question, but I am interested in the details which are not provided there.
I had a look at the documentation of m2eclipse and found it unsatisfactorily laconic. The only relevant part I could find is
Alternatively you can run “Maven / Update project configuration” action from the project popup menu, which is configured to run “process-resources” by default and it can be also changed on the same preference page.
but I could not make whether Update project configuration
is the same as Update project
. All other sources I have found while browsing around do not provide any details either.
To recap, what I would like to know is:
Update project
run any Maven plugin and, if so, which ones and with which default settings?You can right-click on your project then Maven > Update Project..., then select Force Update of Snapshots/Releases checkbox then click OK.
Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information.
Force Update All SNAPSHOT Dependencies. As we know already, Maven will not download existing dependencies again. Therefore, to force Maven to update all corrupted SNAPSHOT dependencies, we should add in our command the -U/–update-snapshots option: mvn package -U mvn install -U.
Does Update project run any Maven plugin and, if so, which ones and with which default settings?
During the update project, m2eclipse uses maven-core build project object model. Specifically, maven model builder is used to build project model. In other words, it leads to dependency resolution, error and warning notification. For more information about the result, you can check org.apache.maven.project.ProjectBuildingResult
I don't think that it results in running of plugins. I took a cursory look and phase 2 while doing update is not enabled which does plugin processing.
Are there effects which are not a result of a Maven plugin, but are internal to Eclipse?
Yes. See the end section of the answer.
What are the modifications on the project structure? For instance, are Maven dependencies copied locally?
If by locally you mean, in eclipse workspace then no. Maven Dependencies shows reference to the local repository which is usually /.m2/repository. The Repository is also resolved based on the setting of Eclipse menu "Windows->Preference->User Settings".
For further information, you can begin from the following source code (one of the methods invoked when you do update project in eclipse),
public IStatus runInWorkspace(IProgressMonitor monitor) {
...... Unimportant stuff
MavenUpdateRequest request = new MavenUpdateRequest(projects, offline,forceUpdateDependencies);
Map<String, IStatus> updateStatus = configurationManager.updateProjectConfiguration(request, updateConfiguration,
cleanProjects, refreshFromLocal, monitor);
...... Unimportant stuff
}
Summary of different tasks performed (not exhaustive)
Additionally, it also does some stuff with parent pom presence in the workspace which is not very important in this context.
Update Project configuration is majorly related to
project.build.sourceEncoding
maven property.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With