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

前端 未结 3 1222
臣服心动
臣服心动 2020-12-15 01:28

Recently I converted my GWT web-app (GWT 2.4.0) to a maven project.
I am using maven 2.2.1, gwt-maven plugin (2.4.0), Eclipse Indigo (3.7) and the m2ecl

相关标签:
3条回答
  • 2020-12-15 01:45

    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.

    0 讨论(0)
  • 2020-12-15 02:05

    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>).

    0 讨论(0)
  • 2020-12-15 02:07

    Well, I usually uncheck :

    Project | Build Automatically

    I just hate it getting compiling all the time.

    0 讨论(0)
提交回复
热议问题