GWT 1.6项目战争布局 - 混合源代码和编译器生成的工件?

时间:2022-09-06 12:48:49

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.

刚刚完成了一个基于GWT-1.5的项目,我正在研究一下迁移到1.6时我们必须做些什么。我很惊讶地发现GWT似乎想把它的编译输出写入war目录,你通常会在源代码控制下拥有项目。

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.

有人建议我使用-war选项指定输出目录。我写了一些ANT脚本,并且大部分都在工作。我不得不将我的静态资源(如HTML,JSP等)复制到此目录中(我使用的是target / war,maven-style)。这是大多数人在做什么?或者你只是让GWT将其输出写入源代码控制的战争目录,并告诉你的VCS忽略非版本控制的文件?在我看来,让GWT直接写入这个目录可能会有一些好处,因为Jetty可以自动注意到对JSP,HTML等的更改,并避免必须进行复制以使这些更改可见。

3 个解决方案

#1


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

使用“-war”选项控制输出的位置。

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

仅供参考:Wiki有设计文档,希望能够让您对他们的想法有所了解。

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

另请参阅讨论新项目布局的发行说明,以及此更改需要注意的一些事项。

#2


Salvador Diaz has provided an excellent solution to this.

Salvador Diaz为此提供了出色的解决方案。

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

是的,看看-war选项可能会有所帮助。我正在做什么(可能不像maven一样干净,我不使用-war)是我将整个项目目录放在SVN上,然后忽略保存js和其他编译bs的子目录班级目录。这样我在源代码控制上就拥有了其他一切,包括我想要的库。所以另一个团队成员可以从SVN查看整个项目,编译并准备好了。

#1


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

使用“-war”选项控制输出的位置。

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

仅供参考:Wiki有设计文档,希望能够让您对他们的想法有所了解。

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

另请参阅讨论新项目布局的发行说明,以及此更改需要注意的一些事项。

#2


Salvador Diaz has provided an excellent solution to this.

Salvador Diaz为此提供了出色的解决方案。

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

是的,看看-war选项可能会有所帮助。我正在做什么(可能不像maven一样干净,我不使用-war)是我将整个项目目录放在SVN上,然后忽略保存js和其他编译bs的子目录班级目录。这样我在源代码控制上就拥有了其他一切,包括我想要的库。所以另一个团队成员可以从SVN查看整个项目,编译并准备好了。