the "build automatically" and maven in Eclipse

Eclipse's m2e will run the plugin goals it has lifecycle bindings for. I don't know (and I'm unable to find) what specific phases are run, but from experience I know that:

  • for normal operation, at least compile gets executed.
  • for executing tests (e.g. JUnit test cases), at least test-compile gets executed.

Note that it doesn't have all possible bindings, and going around that problem is sometimes problematic. So, usually, having both should run fine, and in fact will avoid some incongruities due to the compiled state not updating while you code.

However if you have plugins that are ignored by m2e, you should actually shut down "Build Automatically" off when you need to be certain your build completes correctly.

For example, using the Maven Properties plugin, if you have not provided a binding and set m2e to ignore, you will have resources with out-of-whack property values. The problem can especially occur when you do a "Maven" build (from the right-click context menu for example), and then do a change in your code and save it.

Tags:

Eclipse

Maven

M2E