Maven Project Builder is invoked every time I change a source file (GWT)

梦想与她 提交于 2019-11-28 22:02:09

This perfectly illustrates why m2e doesn't let any "unknown" plugins to run on incremental build by default ( http://wiki.eclipse.org/M2E_plugin_execution_not_covered#Background ). Most maven plugins aren't fit for incremental building and do a complete build whenever they're invoked (and as a bonus, you might get classloader leakages).

In your plugin management section, you specified that gwt:resources, gwt:compile and war:exploded should be executed. By default, they're executed on incremental builds, that means on EVERY resource change. Since these goals/plugins aren't optimized for an incremental build, they take a while to complete.

If you want to speed things up, you can tell m2e to execute them only on Full builds (i.e. after a project clean) by using

<execute>
  <runOnIncremental>false</runOnIncremental>
</execute>

Then, manually doing an eclipse clean build will automatically trigger their execution. Be aware that JDT sometimes decides to promote incremental builds to full ones.

I believe (but may be wrong) that, if you were using the Google Eclipse Plugin, you could ignore gwt:resources and gwt:compile altogether (by replacing <execute> with <ignore>).

The reason for the Maven build is more than likely an enabled Maven Project Builder (Project properties > Builders).

You can disable it and -- as long as you have the Java Builder selected -- Eclipse will continue to compile edited files.

Well, I usually uncheck :

Project | Build Automatically

I just hate it getting compiling all the time.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!