簡體   English   中英

將gwteventservice添加為Maven依賴項中斷項目

[英]Adding gwteventservice as Maven dependency breaks project

我有一個相當大的GWT應用程序,我想嘗試gwteventservice。 為此,我從Maven存儲庫頁面獲取了1.2.1版的依賴項:

<dependency>
    <groupId>de.novanic.gwteventservice</groupId>
    <artifactId>eventservice</artifactId>
    <version>1.2.1</version>
</dependency>

將其添加到我的pom.xml ,更新了Maven依賴關系並完成了項目的全新構建后,突然出現了許多編譯器錯誤。
我從Eclipse的“問題”選項卡中復制了相關消息(每行是一個單獨的條目):

The method setCellStyleNames(String) is undefined for the type Column<T,capture#5-of ?>
The constructor SimplePager(SimplePager.TextLocation, boolean, int, boolean) is undefined
com.google.gwt.cell.client.Cell.Context cannot be resolved to a type
com.google.gwt.cell.client.Cell.Context cannot be resolved to a type
The method getSafeUri() is undefined for the type ImageResource GameSearchTable.java
The method getSafeUri() is undefined for the type ImageResource GameSearchTable.java
The method getSafeUri() is undefined for the type ImageResource GameSearchTable.java
The method getSafeUri() is undefined for the type ImageResource GameSearchTable.java
The method getSafeUri() is undefined for the type ImageResource GameSearchTable.java
The method setSortable(boolean) is undefined for the type GameSearchTable.RatingColumn
The method setSortable(boolean) is undefined for the type GameSearchTable.StatusColumn
The method setSortable(boolean) is undefined for the type TextColumn<GameDTO>
The method setSortable(boolean) is undefined for the type TextColumn<GameDTO>
The type GameSearchTable.RatingCell must implement the inherited abstract method AbstractCell<GameDTO>.render(GameDTO, Object, SafeHtmlBuilder)
The type GameSearchTable.StatusCell must implement the inherited abstract method AbstractCell<GameDTO>.render(GameDTO, Object, SafeHtmlBuilder)
com.google.gwt.cell.client.Cell.Context cannot be resolved to a type
com.google.gwt.cell.client.Cell.Context cannot be resolved to a type
The method getSafeUri() is undefined for the type ImageResource
The method getSafeUri() is undefined for the type ImageResource
The method getSafeUri() is undefined for the type ImageResource
The method getSafeUri() is undefined for the type ImageResource
The method getSafeUri() is undefined for the type ImageResource
The method setSortable(boolean) is undefined for the type GameTable.RatingColumn
The method setSortable(boolean) is undefined for the type GameTable.StatusColumn
The method setSortable(boolean) is undefined for the type TextColumn<GameDTO>
The type GameTable.RatingCell must implement the inherited abstract method AbstractCell<GameDTO>.render(GameDTO, Object, SafeHtmlBuilder)
The type GameTable.StatusCell must implement the inherited abstract method AbstractCell<GameDTO>.render(GameDTO, Object, SafeHtmlBuilder)
The constructor ActivityManager(ActivityMapper, EventBus) is undefined
The method register(com.google.gwt.place.shared.PlaceController, com.google.gwt.event.shared.EventBus, com.google.gwt.place.shared.Place) in the type PlaceHistoryHandler is not applicable for the arguments (com.google.gwt.place.shared.PlaceController, com.google.web.bindery.event.shared.EventBus, com.google.gwt.place.shared.Place)
The constructor PlaceController(EventBus) is undefined
com.google.gwt.cell.client.Cell.Context cannot be resolved to a type
com.google.gwt.cell.client.Cell.Context cannot be resolved to a type
com.google.gwt.cell.client.Cell.Context cannot be resolved to a type
Context cannot be resolved to a type
Context cannot be resolved to a type
The method getSafeUri() is undefined for the type ImageResource
The method getSafeUri() is undefined for the type ImageResource
The method getSafeUri() is undefined for the type ImageResource
The method getSafeUri() is undefined for the type ImageResource
The method getSafeUri() is undefined for the type ImageResource
The method setSortable(boolean) is undefined for the type PlatformTable.ProgressBarColumn
The method setSortable(boolean) is undefined for the type PlatformTable.RatingColumn
The method setSortable(boolean) is undefined for the type PlatformTable.StatusColumn
The method setSortable(boolean) is undefined for the type TextColumn<PlatformDTO>
The type PlatformTable.ProgressBarCell must implement the inherited abstract method AbstractCell<PlatformDTO>.render(PlatformDTO, Object, SafeHtmlBuilder)
The type PlatformTable.RatingCell must implement the inherited abstract method AbstractCell<PlatformDTO>.render(PlatformDTO, Object, SafeHtmlBuilder)
The type PlatformTable.StatusCell must implement the inherited abstract method AbstractCell<PlatformDTO>.render(PlatformDTO, Object, SafeHtmlBuilder)
The method setWidget(int, int, Widget) in the type HTMLTable is not applicable for the arguments (int, int, IsWidget)
The method setWidget(int, int, Widget) in the type HTMLTable is not applicable for the arguments (int, int, IsWidget)

有趣的是,這些僅顯示在代碼的客戶端 在沒有添加依賴的情況下,我的應用程序可以正常編譯。

我的環境:

  • Java 1.7.0_55
  • GWT 2.6.0
  • Maven的3.3.1

到目前為止我沒有成功嘗試過的東西:

  • 在我的pom.xml中使用gwteventservice的早期版本(1.2.0)
  • Eclipse建議使用Quick-Fix將gwt-user.jar添加到我的構建路徑中
  • 將依賴項gwt-user添加到我的pom.xml
  • 將相關的外部jar直接添加到我的構建路徑中(這是唯一起作用的方法,但是我真的不喜歡此解決方案……我寧願將所有內容都放在pom.xml

所以問題是:

  • 為什么添加依賴項會破壞我的項目,並且
  • 我怎樣才能解決這個問題?

如果沒有其他幫助,我可能會改用gwt-comet

如您在此處看到的, gwteventservice依賴於gwt 2.1.0。 我認為您無法在GWT 2.6.0中使用它。

嘗試排除從事件服務中繼承而來的依賴關系。

<dependencies>
  ....
  <dependency>
     <groupId>de.novanic.gwteventservice</groupId>
     <artifactId>eventservice</artifactId>
     <version>1.2.1</version>
     <exclusions>
        <exclusion>
           <artifactId>gwt-servlet</artifactId>
           <groupId>com.google.gwt</groupId>
        </exclusion>
        <exclusion>
           <artifactId>gwt-user</artifactId>
           <groupId>com.google.gwt</groupId>
        </exclusion>
     </exclusion>
  </dependency>
  <dependency>
      <artifactId>gwt-user</artifactId>
      <groupId>com.google.gwt</groupId>
      <version>2.6.0</version>
  </dependency>
  <dependency>
      <artifactId>gwt-servlet</artifactId>
      <groupId>com.google.gwt</groupId>
      <version>2.6.0</version>
  </dependency>
  ....
</dependencies>

但是您需要為它們兩者提供依賴關系(即使您不需要它們),而eventservice會尋找它們。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM