GWT 1.6 project war layout- mixing source code & compiler-generated artifacts?

GWT 1.6 project war layout- mixing source code & compiler-generated artifacts?

各自安好 发布于 2021-11-30 字数 1258 浏览 926 回复 3 原文

Having just wrapped up a GWT-1.5 based project, I'm taking a look at what we'll have to do to migrate to 1.6. I'm very surprised to see that GWT seems to want to write its compiled output to the war directory, where you would normally have items under source control.

What's the reason behind this? Did Google really think this was a good idea? Is there a workaround to keep source code separate from compiler-generated artifacts? Is there some other reason for this that I'm missing?

EDIT:

It's been suggested that I use the -war option to specify an output directory. I wrote some ANT scripts, and have this mostly working. I've had to copy over my static resources such as HTML, JSPs, etc into this directory (I'm using target/war, maven-style). Is that what most people are doing? Or are you just letting GWT write its output into your source-code-controlled war dir, and telling your VCS to ignore the non-version-controlled files? It occurred to me that there might be some benefit to letting GWT write to this dir directly, since then Jetty could automatically notice changes to JSPs, HTML etc, and avoid having to do a copy to make these changes visible.

如果你对这篇文章有疑问,欢迎到本站 社区 发帖提问或使用手Q扫描下方二维码加群参与讨论,获取更多帮助。

扫码加入群聊

发布评论

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

评论(3

浅暮の光 2022-06-07 3 楼

Yep, look at the -war option which may help.
What I'm doing (which may not be as clean as maven, and I dont use the -war) is I'm putting my entire project dir on SVN, and then ignoring the subdir that holds the js and other compiled bs along with the classes dir. That way I have everything else on source control, including the libs which I wanted. So another team member can just check out the whole project from SVN, compile, and ready to go.

当梦初醒 2022-06-07 2 楼

Salvador Diaz has provided an excellent solution to this.

血之狂魔 2022-06-07 1 楼

Use the "-war" option to control where the output goes.

FYI: The Wiki has the design doc which will, hopefully, give you a bit of insight as to what they were thinking.

See also the Release Notes which discuss the new project layout, as well as some things to watch out for with this change.