编辑:在末尾添加了mvn -X -e命令的一些输出
我公司正在开发GWT应用程序。我们已经成功使用了maven 2和GWT 1.7一段时间了。我们最近决定升级到GWT 2.0。我们已经更新了eclipse项目,并且能够在dev模式下成功运行该应用程序。
我们正在努力使用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)
...
找到正确的sourceDirectory。该文件夹有一个“ com”文件夹,根据包结构,该文件夹最终是文件夹中组织的应用程序的源。
最佳答案
正如Geoffrey Wiseman所说的那样,您可能会遇到jira.codehaus.org/browse/MGWT-151,这种情况发生在正在构建的模块没有入口点的情况下(大概是因为您是从继承该模块的确实)。虽然问题说它已在2.1.0中修复,但您实际上可以使用gwt-maven-plugin的1.3-SNAPSHOT版本,它将正常工作。
关于maven-2 - 如何使Maven GWT 2.0构建工作,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/2091958/