0

尝试将 KineticGWT 与 Maven 一起使用,但出现以下错误。任何帮助表示赞赏。我的 Application.gwt.xml 也附在下面。

应用程序.gwt.xml:

<!DOCTYPE module PUBLIC "//gwt-module/" "http://google-web-toolkit.googlecode.com/svn/tags/1.6.2/distro-source/core/src/gwt-module.dtd">
<module>
  <inherits name='com.google.gwt.user.User'/>
  <inherits name='com.google.gwt.user.theme.standard.Standard'/>
  <inherits name="net.edzard.kinetic"/>
  <entry-point class='org.gaoshin.openflier.client.Application'/>
  <stylesheet src='Application.css' />
</module>

Maven命令错误:

$ mvn install
[INFO] Compiling module org.gaoshin.openflier.Application
[INFO]    Refreshing module from source
[INFO]       Validating newly compiled units
[INFO]          Removing units with errors
[INFO]             [ERROR] Errors in 'jar:file:/Users/kzhang/.m2/repository/net/edzard/kineticgwt/0.9.2-SNAPSHOT/kineticgwt-0.9.2-SNAPSHOT-sources.jar!/net/edzard/kinetic/Canvas.java'
[INFO]                [ERROR] Line 3: The import com.google.gwt.canvas cannot be resolved
[INFO]                [ERROR] Line 5: The import com.google.gwt.dom.client.CanvasElement cannot be resolved
[INFO]                [ERROR] Line 15: Context2d cannot be resolved to a type    

在 pom.xml 文件中,我包含了 gwt-user 依赖项。我的 gwt 版本是 1.7.1

4

3 回答 3

1

Canvas 已经在 GWT 2.2 中加入,所以升级你的中年 GWT。

另请注意,KineticGWT 0.9.2-SNAPSHOT 是针对 GWT 2.5.0 构建的,因此您可能希望使用该版本(GWT 开发中的经验法则:尽快升级到最新的稳定版本;这是一般建议,但特别适用于 GWT)

于 2012-11-13T16:41:15.533 回答
0

您还记得包含 GWT 依赖项吗?

<dependency>
    <groupId>com.google.gwt</groupId>
    <artifactId>gwt-user</artifactId>
    <version>${gwtVersion}</version>
</dependency>
于 2012-11-13T08:51:32.610 回答
0

感谢 Thomas 的 gwt 版本建议。我还从 Kineticgwt 的开发人员那里得到了一些帮助。事实证明,我需要升级两件事。一个用于 gwt,另一个用于 gwt maven 插件。

插件版本:

        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>gwt-maven-plugin</artifactId>
            <version>2.5.0-rc2</version>
            <executions>
                <execution>
                    <goals>
                        <goal>compile</goal>
                    </goals>
                </execution>
            </executions>

gwt版本:

    <dependency>
        <groupId>com.google.gwt</groupId>
        <artifactId>gwt-servlet</artifactId>
        <version>2.5.0</version>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>com.google.gwt</groupId>
        <artifactId>gwt-user</artifactId>
        <version>2.5.0</version>
        <scope>provided</scope>
    </dependency>
于 2012-11-13T17:26:47.410 回答