Search code examples
eclipsemavenmaven-3m2eclipse

What is the difference between maven update and maven build?


With m2e-plugin we can right click on a project and then click on Maven update or we can click on Run As -> Maven build. What is the difference between them? What is the background operation that is performed when each option is chosen?

Because as far as I can see.. the information provided in that status bar says that it is "Building the workpace". What does it mean by that? What exactly is updating the project?


Solution

  • When you run maven update - your local maven repository gets updated with the latest jars from central repository. This is important for SNAPSHOT versions of artifacts. SNAPSHOT version of artifacts in the local repository maybe out of date with what's currently available in your central repository. *build happens in eclipse because the build automatically option is selected. if it's not it won't happen.

    When build - complies, runs test and builds you current projects artifacts. maven build usually includes a maven update phase unless run with the offline option (-o).