如何让maven gwt 2.0构建工作

问题描述 投票:3回答:2

编辑:最后添加了一些mvn -X -e命令的输出

我的公司正在开发GWT应用程序。我们已经成功使用maven 2和GWT 1.7了一段时间。我们最近决定升级到GWT 2.0。我们已经更新了eclipse项目,我们能够以dev模式成功运行应用程序。

我们正在努力使用maven构建应用程序。我希望有人可以告诉我这里我做错了什么,因为我已经没时间了。

令我担心的输出的确切位是'GWT compilation skipped'消息:

[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'文件夹,其中最终是根据包结构在文件夹中组织的应用程序的源。

maven-2 gwt build-automation
2个回答
1
投票

正如Geoffrey Wiseman所说,你可能会遇到jira.codehaus.org/browse/MGWT-151,当你正在构建的模块没有入口点时会发生这种情况(可能是因为你继承了一个模块,一样)。虽然问题在2.1.0中已经修复,但你实际上可以使用gwt-maven-plugin的1.3-SNAPSHOT版本,它可以正常工作。


0
投票

根据the compile example in the plugin documentation尝试删除声明

您还可以忽略“模块”参数,以便插件扫描项目中的gwt.xml模块文件。

© www.soinside.com 2019 - 2024. All rights reserved.