Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I stop the m2eclipse plugin interfering with command line mvn builds?

I use the m2eclipse plugin in Eclipse so that I can import a Maven project. The plugin reads the pom.xml and sorts out the dependencies in the projects in an Eclipse friendly way so I'm not looking at a sea of broken references and errors.

I use Eclipse for code development however I usually build the projects from the command line, e.g. "mvn clean install".

Unfortunately when I do this, m2eclipse detects disk activity and attempts to rebuild the workspace. This interferes with the command line build and sometimes results in a race condition. For example the command line might be in its clean phase but fails because it tries to delete a file or directory which is locked during the workspace rebuild. Aside from that workspace rebuilding is incredibly slow, and between failed builds and wasted CPU my build process is 2-3x longer than it should be.

It isn't an option to not use Eclipse (e.g. to use Netbeans), or to disable m2eclipse. It is a useful plugin except for this behaviour.

So my question is, how do I stop m2eclipse from rebuilding the workspace all the time? Can I invoke a manual refresh and otherwise disable this behaviour?

like image 761
locka Avatar asked Nov 06 '22 05:11

locka


1 Answers

As a quick fix, you could deactivate automated Eclipse builds unticking Project > Build Automatically

like image 157
dimitrisli Avatar answered Nov 09 '22 10:11

dimitrisli