eclipsegwtmavengwt-compiler

How to compile only changed parts of gwt modules?


We decided to use gwt modules in our application about 1 week ago. We use gwt-maven-eclipse trio and we already configured phases and goals. Also we are doing context deploying to decrease development and testing time.

BUT;

When we package or tomcat:deploy our application, gwt modules are re-compiling(including unchanged ones).

<set-property name="user.agent" value="gecko1_8"></set-property>
<extend-property name="locale" values="en_UK"></extend-property>

I already set these properties up here to speed up compiling time but this is not what i want exactly... I also configured maven lifecycle mapping in eclipse to fire gwt:compile process-resources resources:testResources when any resources change. But it blocks eclipse and that was not helpful about compiling time either.

This is gwt-maven-plugin configuration in pom.xml

<plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>gwt-maven-plugin</artifactId>
                <version>2.3.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                </executions>
                <!--
                    Plugin configuration. There are many available options, see
                    gwt-maven-plugin documentation at codehaus.org
                -->
                <configuration>
                    <runTarget>A.jsp</runTarget>
                    <runTarget>B.jsp</runTarget>
                    <hostedWebapp>${webappDirectory}</hostedWebapp>
                </configuration>
            </plugin>

Any idea to help me?


Solution

  • gwt-maven-plugin tries (hard) to avoid recompiling modules when the code hasn't changed, but even that takes a bit of time (still less than re-compiling the module; and unfortunately if it detects the module needs to be recompiled, it adds up to the GWT compile time).

    If you know you don't need gwt:compile, you can pass -Dgwt.compiler.skip=true to your Maven build to skip the goal and keep "running" your previously compiled code. Similarly, if you know you need gwt:compile, you can pass -Dgwt.compiler.force=true to bypass the "up-to-date check".