简体   繁体   English

如何从命令行运行Google Web Toolkit应用程序?

[英]How do I run Google Web Toolkit applications from the command line?

At the moment I'm running the demo StockWatcher in Eclipse. 目前我正在Eclipse中运行StockWatcher演示。 This uses the embedded servlet container which is fine for my purposes. 这使用嵌入式servlet容器,这对我来说很好。 The only change I would like to make is running from the command line instead of inside Eclipse. 我想做的唯一改变是从命令行而不是在Eclipse内部运行。 Does anyone know what command I use and what classpath this requires? 有谁知道我使用什么命令以及这需要什么类路径?

Edit - I have not used maven I have created the project purely using eclipse and gwt plugin 编辑 - 我没有使用过maven我已经创建了纯粹使用eclipse和gwt插件的项目

If you used the webAppCreator wizard (I see that you used the Eclipse plugin, but maybe both of them used the same code internally), you should have an ant script ( build.xml ) generated for you. 如果您使用了webAppCreator向导(我看到您使用了Eclipse插件,但可能两者都在内部使用了相同的代码),您应该为您生成一个ant脚本( build.xml )。 With it you can run the GWT app via targets so: 有了它,您可以通过目标运行GWT应用程序,以便:

  • ant hosted - run hosted mode (or Development mode, I'm looking at a fairly old ant script) ant hosted - 运行托管模式(或开发模式,我正在看一个相当古老的ant脚本)
  • ant gwtc - compile to JS ant gwtc - 编译成JS
  • ant war , ant build , etc. ant warant build

See what's in that file ( build.xml ) to get a better understanding of what is available and what you can do. 查看该文件( build.xml )中的内容,以便更好地了解可用内容和可执行的操作。

Update: see here for documentation on webAppCreator and available ant targets. 更新:请参阅此处获取有关webAppCreator和可用ant目标的文档。

With the maven jetty plugin you can run your application with jetty from command line. 使用maven jetty插件,您可以从命令行使用jetty运行应用程序。 (You first have to compile & create war with maven gwt plugin I think) (你首先必须使用maven gwt插件编译和创建战争)

mvn jetty:run

maven gwt plugin maven gwt插件

maven jetty plugin maven jetty插件

Did you use Maven for this project? 你有没有在这个项目中使用Maven? If that, then you can run it as mvn gwt:run from command line 如果是这样,那么你可以运行它作为mvn gwt:run

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM