我在使用命令行和Eclipse中在开发模式下运行多模块gwt项目时遇到了麻烦:
当我尝试运行(mvn gwt:run -Ddev)使用modular-webapp原型创建的GWT多模块项目时,在开发模式下获得以下错误:
00:00:14.244 [DEBUG] Linking module 'gwtapp'
00:00:14.244 [DEBUG] Linking module 'gwtapp'
00:00:14.244 [TRACE] Linking Public artifacts into C:\work\mvn-workspace\modular-gwtapp\modular-gwtapp-client\target\modular-gwtapp-client-1.0-SNAPSHOT
00:00:14.244 [DEBUG] Emitting resource gwtapp.devmode.js
00:00:14.244 [ERROR] Fatal error emitting artifact: gwtapp.devmode.js
java.io.FileNotFoundException: C:\work\mvn-workspace\modular-gwtapp\modular-gwtapp-client\target\modular-gwtapp-client-1.0-SNAPSHOT\gwtapp\gwtapp.devmode.js (The requested operation cannot be performed on a file with a user-mapped section open)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:212)
at java.io.FileOutputStream.<init>(FileOutputStream.java:165)
at com.google.gwt.dev.util.OutputFileSetOnDirectory$1.<init>(OutputFileSetOnDirectory.java:55)
at com.google.gwt.dev.util.OutputFileSetOnDirectory.createNewOutputStream(OutputFileSetOnDirectory.java:55)
at com.google.gwt.dev.util.OutputFileSet.openForWrite(OutputFileSet.java:82)
at com.google.gwt.core.ext.linker.impl.StandardLinkerContext.produceOutput(StandardLinkerContext.java:508)
at com.google.gwt.dev.DevMode.produceOutput(DevMode.java:588)
at com.google.gwt.dev.DevModeBase.link(DevModeBase.java:1010)
at com.google.gwt.dev.DevModeBase.createArtifactAcceptor(DevModeBase.java:1153)
at com.google.gwt.dev.DevModeBase.doCreateShellModuleSpaceHost(DevModeBase.java:886)
at com.google.gwt.dev.DevModeBase$UiBrowserWidgetHostImpl.createModuleSpaceHost(DevModeBase.java:105)
at com.google.gwt.dev.shell.OophmSessionHandler.loadModule(OophmSessionHandler.java:197)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:526)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
at java.lang.Thread.run(Thread.java:722)
00:00:14.245 [ERROR] Failed to load module 'gwtapp' from user agent 'Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.3; rv:11.0) like Gecko' at 127.0.0.1:49922
以下是我创建示例模块化webapp的步骤:
1
mvn archetype:generate -DarchetypeCatalog=https://oss.sonatype.org/content/repositories/snapshots/ -DarchetypeGroupId=net.ltgt.gwt.archetypes -DarchetypeArtifactId=modular-webapp -DarchetypeVersion=1.0-SNAPSHOT
groupId: com.bala.gwtapp
artifactId: modular-gwtapp
version: 1.0-SNAPSHOT
package: com.bala.gwtapp
module: App
module-short-name: gwtapp
mvn clean install -Dgwt.compiler.skip
cd *-client and mvn gwt:run -Ddev
cd *-server and mvn jetty:start -Ddev
如何使用RunAs配置在IDE(Eclipse)中运行此多模块应用程序。可以理解示例配置 按照以下步骤进行IDE:
如何在IDE(Eclipse)中调试多模块应用程序 - 例如:赞赏示例配置
是否可以使用mvn gwt从命令行附加调试器:debug
此外,当在cmd行中使用maven执行应用程序时,它显示以下警告:
[WARNING] Your POM <build><outputdirectory> does not match your hosted webapp WEB-INF/classes folder for GWT Hosted browser to see your classes
注意:它在Super Dev模式下工作正常 - 使用命令行测试。
我需要解决这些问题,以便为我们的应用程序实现这种多模块方法。
提前致谢。