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

Posted by locka on Stack Overflow See other posts from Stack Overflow or by locka
Published on 2010-12-23T10:20:04Z Indexed on 2010/12/29 7:54 UTC
Read the original article Hit count: 302

Filed under:
|
|

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?

© Stack Overflow or respective owner

Related posts about java

Related posts about eclipse