如何将项目从gwt 2.5.1升级到gwt 2.7.0?

时间:2015-08-31 06:27:23

标签: java maven gwt

我现在正在使用GWT 2.5.1,我想将我的SDK版本更改为2.7.0。我手动下载了最新的SDK并更改了项目属性中的SDK设置。编译器此时抛出的错误是:

ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project citikyc-core-app-web-common: Compilation failure: Compilation failure:
[ERROR] \_ws\core-modules\core-app-modules\citikyc-core-app-web-common\src\main\java\com\citi\kyc\core\app\web\common\kycrecord\bussinessappx\client\widget\AddBusinessAppndxEditor.java:[30,35] package com.google.gwt.widget.client does not exist
[ERROR] \_ws\core-modules\core-app-modules\citikyc-core-app-web-common\src\main\java\com\citi\kyc\core\app\web\common\kycrecord\bussinessappx\client\widget\AddBusinessAppndxEditor.java:[47,12] cannot find symbol
[ERROR] symbol  : class TextButton
[ERROR] location: class com.citi.kyc.core.app.web.common.kycrecord.bussinessappx.client.widget.AddBusinessAppndxEditor
[ERROR] \_ws\core-modules\core-app-modules\citikyc-core-app-web-common\src\main\java\com\citi\kyc\core\app\web\common\kycrecord\bussinessappx\client\widget\AddBusinessAppndxEditor.java:[84,25] cannot find symbol
[ERROR] symbol  : class TextButton
[ERROR] location: class com.citi.kyc.core.app.web.common.kycrecord.bussinessappx.client.widget.AddBusinessAppndxEditor
[ERROR] \_ws\core-modules\core-app-modules\citikyc-core-app-web-common\src\main\java\com\citi\kyc\core\app\web\common\admin\riskmodel\client\widget\ManageResponseEditor.java:[152,33] cannot find symbol
[ERROR] symbol  : constructor TreeItem(java.lang.String)
[ERROR] location: class com.google.gwt.user.client.ui.TreeItem
[ERROR] \_ws\core-modules\core-app-modules\citikyc-core-app-web-common\src\main\java\com\citi\kyc\core\app\web\common\admin\riskmodel\client\widget\ManageResponseEditor.java:[162,33] cannot find symbol
[ERROR] symbol  : constructor TreeItem(java.lang.String)
[ERROR] location: class com.google.gwt.user.client.ui.TreeItem
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project citikyc-core-app-web-common: Compilation failure
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)

跟踪的第二行指向TextButton类对象声明,该声明是根据gwt 2.5.1包结构从com.google.gwt.widget.client包导入的。但我无法在gwt 2.7.0中找到任何类似的类。我该如何解决这个问题?

1 个答案:

答案 0 :(得分:2)

用Button类替换TextButton用法。它有一个构造函数,可以将String或SafeHtml显示为文本。如果您愿意,可以稍后对其应用不同的样式。

/**
   * Creates a button with the given HTML caption.
   *
   * @param html the HTML caption
   */
  public Button(SafeHtml html) {
    this(html.asString());
  }

  /**
   * Creates a button with the given HTML caption.
   *
   * @param html the HTML caption
   */
  public Button(String html) {
    this();
    setHTML(html);
  }