如何让 Maven GWT 2.0 构建工作
编辑:在最后添加了 mvn -X -e 命令的一些输出
我的公司正在开发 GWT 应用程序。我们已经成功使用 Maven 2 和 GWT 1.7 有一段时间了。我们最近决定升级到 GWT 2.0。我们已经更新了 eclipse 项目,并且能够在开发模式下成功运行该应用程序。
不过,我们正在努力使用 Maven 构建应用程序。我希望有人能告诉我我在这里做错了什么,因为我已经没有时间了。
让我担心的输出的确切部分是“GWT 编译已跳过”消息:
[INFO] Copying 119 resources
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Compiling 704 source files to K:\iCura\assessor\target\classes
[INFO] [gwt:compile {execution: default}]
[INFO] using GWT jars for specified version 2.0.0
[INFO] establishing classpath list (scope = compile)
[INFO] com.curasoftware.assessor.Assessor is up to date. GWT compilation skipped
[INFO] [jspc:compile {execution: jspc}]
[INFO] Built File: \index.jsp
我正在粘贴下面的 gwt-maven-plugin 部分。如果您还需要什么,请询问。
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>1.2</version>
<configuration>
<localWorkers>1</localWorkers>
<warSourceDirectory>${basedir}/war</warSourceDirectory>
<logLevel>ALL</logLevel>
<module>${cura.assessor.module}</module>
<!-- use style OBF for prod -->
<style>OBFUSCATED</style>
<extraJvmArgs>-Xmx2048m -Xss1024k</extraJvmArgs>
<gwtVersion>${version.gwt}</gwtVersion>
<disableCastChecking>true</disableCastChecking>
<soyc>false</soyc>
</configuration>
<executions>
<execution>
<goals>
<!-- plugin goals -->
<goal>clean</goal>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
我执行了 mvn clean install -X -e 这是我得到的一些输出:
[DEBUG] Configuring mojo 'org.codehaus.mojo:gwt-maven-plugin:1.2:compile' -->
[DEBUG] (f) disableCastChecking = true
[DEBUG] (f) disableClassMetadata = false
[DEBUG] (f) draftCompile = false
[DEBUG] (f) enableAssertions = false
[DEBUG] (f) extra = K:\iCura\assessor\target\extra
[DEBUG] (f) extraJvmArgs = -Xmx2048m -Xss1024k
[DEBUG] (f) force = false
[DEBUG] (f) gen = K:\iCura\assessor\target\.generated
[DEBUG] (f) generateDirectory = K:\iCura\assessor\target\generated-sources\gwt
[DEBUG] (f) gwtVersion = 2.0.0
[DEBUG] (f) inplace = false
[DEBUG] (f) localRepository = Repository[local|file://K:/iCura/lib]
[DEBUG] (f) localWorkers = 1
[DEBUG] (f) logLevel = ALL
[DEBUG] (f) module = com.curasoftware.assessor.Assessor
[DEBUG] (f) project = MavenProject: com.curasoftware.assessor:assessor:3.5.0.0 @ K:\iCura\assessor\pom.xml
[DEBUG] (f) remoteRepositories = [Repository[gwt-maven|http://gwt-maven.googlecode.com/svn/trunk/mavenrepo/], Repository[main-maven|http://www.ibiblio.org/maven2/], Repository[central|http://repo1.maven.org/maven2]]
[DEBUG] (f) skip = false
[DEBUG] (f) sourceDirectory = K:\iCura\assessor\src
[DEBUG] (f) soyc = false
[DEBUG] (f) style = OBFUSCATED
[DEBUG] (f) treeLogger = false
[DEBUG] (f) validateOnly = false
[DEBUG] (f) warSourceDirectory = K:\iCura\assessor\war
[DEBUG] (f) webappDirectory = K:\iCura\assessor\target\assessor
[DEBUG] -- end configuration --
然后是:
[DEBUG] SOYC has been disabled by user
[DEBUG] GWT module com.curasoftware.assessor.Assessor found in K:\iCura\assessor\src
[INFO] com.curasoftware.assessor.Assessor is up to date. GWT compilation skipped
[DEBUG] com.curasoftware.assessor:assessor:war:3.5.0.0 (selected for null)
[DEBUG] com.curasoftware.dto:dto-gen:jar:3.5.0.0:compile (selected for compile)
...
它正在找到正确的源目录。该文件夹有一个“com”文件夹,其中最终是根据包结构组织在文件夹中的应用程序的源。
EDIT: Added some of the output of the mvn -X -e commands at the end
My company is developing a GWT application. We've been using maven 2 and GWT 1.7 successfully for quite a while. We recently decided to upgrade to GWT 2.0. We've already updated the eclipse project and we are able to successfully run the application in dev-mode.
We are struggling to get the application built using maven though. I'm hoping somebody can tell me what I'm doing wrong here since I'm running out of time on this.
The exacty bit of the output that worries me is the 'GWT compilation skipped' message:
[INFO] Copying 119 resources
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Compiling 704 source files to K:\iCura\assessor\target\classes
[INFO] [gwt:compile {execution: default}]
[INFO] using GWT jars for specified version 2.0.0
[INFO] establishing classpath list (scope = compile)
[INFO] com.curasoftware.assessor.Assessor is up to date. GWT compilation skipped
[INFO] [jspc:compile {execution: jspc}]
[INFO] Built File: \index.jsp
I'm pasting the gwt-maven-plugin section below. If you need anything else please ask.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>1.2</version>
<configuration>
<localWorkers>1</localWorkers>
<warSourceDirectory>${basedir}/war</warSourceDirectory>
<logLevel>ALL</logLevel>
<module>${cura.assessor.module}</module>
<!-- use style OBF for prod -->
<style>OBFUSCATED</style>
<extraJvmArgs>-Xmx2048m -Xss1024k</extraJvmArgs>
<gwtVersion>${version.gwt}</gwtVersion>
<disableCastChecking>true</disableCastChecking>
<soyc>false</soyc>
</configuration>
<executions>
<execution>
<goals>
<!-- plugin goals -->
<goal>clean</goal>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
I executed mvn clean install -X -e and this is some of the output that I get:
[DEBUG] Configuring mojo 'org.codehaus.mojo:gwt-maven-plugin:1.2:compile' -->
[DEBUG] (f) disableCastChecking = true
[DEBUG] (f) disableClassMetadata = false
[DEBUG] (f) draftCompile = false
[DEBUG] (f) enableAssertions = false
[DEBUG] (f) extra = K:\iCura\assessor\target\extra
[DEBUG] (f) extraJvmArgs = -Xmx2048m -Xss1024k
[DEBUG] (f) force = false
[DEBUG] (f) gen = K:\iCura\assessor\target\.generated
[DEBUG] (f) generateDirectory = K:\iCura\assessor\target\generated-sources\gwt
[DEBUG] (f) gwtVersion = 2.0.0
[DEBUG] (f) inplace = false
[DEBUG] (f) localRepository = Repository[local|file://K:/iCura/lib]
[DEBUG] (f) localWorkers = 1
[DEBUG] (f) logLevel = ALL
[DEBUG] (f) module = com.curasoftware.assessor.Assessor
[DEBUG] (f) project = MavenProject: com.curasoftware.assessor:assessor:3.5.0.0 @ K:\iCura\assessor\pom.xml
[DEBUG] (f) remoteRepositories = [Repository[gwt-maven|http://gwt-maven.googlecode.com/svn/trunk/mavenrepo/], Repository[main-maven|http://www.ibiblio.org/maven2/], Repository[central|http://repo1.maven.org/maven2]]
[DEBUG] (f) skip = false
[DEBUG] (f) sourceDirectory = K:\iCura\assessor\src
[DEBUG] (f) soyc = false
[DEBUG] (f) style = OBFUSCATED
[DEBUG] (f) treeLogger = false
[DEBUG] (f) validateOnly = false
[DEBUG] (f) warSourceDirectory = K:\iCura\assessor\war
[DEBUG] (f) webappDirectory = K:\iCura\assessor\target\assessor
[DEBUG] -- end configuration --
and then this:
[DEBUG] SOYC has been disabled by user
[DEBUG] GWT module com.curasoftware.assessor.Assessor found in K:\iCura\assessor\src
[INFO] com.curasoftware.assessor.Assessor is up to date. GWT compilation skipped
[DEBUG] com.curasoftware.assessor:assessor:war:3.5.0.0 (selected for null)
[DEBUG] com.curasoftware.dto:dto-gen:jar:3.5.0.0:compile (selected for compile)
...
It's finding the correct sourceDirectory. That folders has a 'com' folder within which ultimately is the source of the application organized in folders as per the package structure.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
正如 Geoffrey Wiseman 所说,您可能会遇到 jira.codehaus.org/browse/MGWT-151,当您正在构建的模块没有入口点时就会发生这种情况(大概是因为您继承自一个做)。虽然问题说它已在 2.1.0 中修复,但您实际上可以使用 gwt-maven-plugin 的 1.3-SNAPSHOT 版本,并且它可以正常工作。
As stated by Geoffrey Wiseman, you may be running into jira.codehaus.org/browse/MGWT-151, which happens when the module you're building doesn't have an entry point (presumably because you're inheriting from a module that does). While the issue says that it's fixed in 2.1.0, you can actually use the 1.3-SNAPSHOT version of the gwt-maven-plugin and it will work fine.
尝试删除声明,按照插件文档中的编译示例
Try removing the declaration, as per the compile example in the plugin documentation