如何仅编译 gwt 模块的更改部分?

发布于 2024-11-18 11:58:46 字数 1690 浏览 4 评论 0原文

大约 1 周前,我们决定在我们的应用程序中使用 gwt 模块。我们使用 gwt-maven-eclipse 三重奏,并且我们已经配置了阶段和目标。此外,我们正在进行上下文部署以减少开发和测试时间。

但是;

当我们打包tomcat:deploy我们的应用程序时,gwt模块会重新编译(包括未更改的模块) )。

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

我已经在此处设置了这些属性以加快编译时间,但这并不是我想要的...... 我还在 eclipse 中配置了 maven 生命周期映射,以便在任何资源发生更改时触发 gwt:compile process-resources resources:testResources。但它会阻止 Eclipse,这对编译时间也没有帮助。

这是 pom.xml 中的 gwt-maven-plugin 配置

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

有什么想法可以帮助我吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

看春风乍起 2024-11-25 11:58:46

gwt-maven-plugin 尝试(努力)避免在代码未更改时重新编译模块,但即使这样也需要一些时间(仍然少于重新编译模块;不幸的是,如果它检测到模块需要重新编译,它加起来就是 GWT 编译时间)。

如果您知道不需要gwt:compile,则可以将-Dgwt.compiler.skip=true传递给您的Maven构建以跳过目标并继续“运行”之前编译的代码。同样,如果您知道您需要 gwt:compile,则可以传递 -Dgwt.compiler.force=true 来绕过“up-to -日期检查”。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文