我使用 Maven 插件创建了 gwt 项目:
mvn -DarchetypeGroupId=org.codehaus.mojo -DarchetypeArtifactId=gwt-maven-plugin -DarchetypeVersion=2.5.1 -DgroupId=com.savdev.BasicGwtProject -DartifactId=BasicGwtProject -Dversion=1.0 org.apache.maven.plugins:maven-archetype-plugin:generate
在项目设置中,我添加了 GWT 方面。当我将 GWT 的路径设置为 GWT 安装目录(gwt-2.5.1 版本)时,出现警告:
路径不是有效的 GWT 安装:在 jar 中找不到类“com.google.gwt.dev.GWTCompiler”:...gwt-dev.jar
我可以修复它吗? IDEA提供GWT下载,但是已经下载了,而且是最后一个版本。也许 IDEA 仍然不支持上一个 GWT 版本?
第二个问题, 我已经运行:maven install。输出为:
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running junit.framework.TestSuite@2ad1e832
[INFO] Please navigate your browser to this URL:
[INFO] http://169.254.56.62:55728/com.savdev.BasicGwtProject.gwtBasicModuleJUnit.JUnit/junit-standards.html?gwt.codesvr=169.254.56.62:55724
我已经浏览过了,但浏览器没有任何响应。 (顺便说一句,我安装了 GWT 开发人员插件
)。它实际上应该在这里做什么?
我想发现的最后一个问题也是关于运行应用程序的。
我已按照 here 的描述在 Project/Edit configuration/GWT configuration
中进行配置。除了我把起始页选项留空。
然后我在IDEA中运行配置。现在我可以看到输出:
[WARN] Server class 'com.google.gwt.junit.server.JUnitHostImpl' could not be found in the web app, but was found on the system classpath
[WARN] Adding classpath entry 'file:/C:/Users/sav/.m2/repository/com/google/gwt/gwt-user/2.5.1/gwt-user-2.5.1.jar' to the web app classpath for this session
For additional info see: file:/D:/DevSoft/gwt-2.5.1/doc/helpInfo/webAppClassPath.html
[WARN] No startup URLs supplied and no plausible ones found -- use -startupUrl
Dev Mode initialized
我目前不确定这些警告是什么,但是,我尝试访问页面:
http://localhost:8888/
我只能看到 WEB-INF 和以我的模块名称命名的文件夹 - 'gwtBasicModule'
。
我查看 web.xml 并发现:
<!-- Default page to serve -->
<welcome-file-list>
<welcome-file>gwtBasicModule.html</welcome-file>
</welcome-file-list>
还存在生成的 gwtBasicModule.html 文件。为什么我访问http://localhost:8888/
页面看不到它?如何通过 IDEA 和 Maven gwt 插件正确运行应用程序?
最佳答案
您必须配置您的 test mode
关于java - Gwt + Maven + Idea,配置和运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16254693/