0

我正在尝试导入 com.vaadin.shared.ui.JavaScriptComponentState。我在 vaadin 7 中使用了这个导入,但是当我更新到 vaadin 8 时,我不能再这样做了。我在 pom 中使用 vaadin bom 8.0.3。任何提示我在这里做错了什么?

import com.vaadin.shared.ui.JavaScriptComponentState;


public class Graph extends JavaScriptComponentState {
    private ArrayList<String> nodes;
    private ArrayList<String> edges;

   public ArrayList<String> getNodes() {
       return nodes;
   }

   public ArrayList<String> getEdges() {
       return edges;
   }
}

错误:

The import com.vaadin.shared.ui.JavaScriptComponentState cannot be resolved
4

1 回答 1

1

您的 pom.xml 必须具有vaadin-server依赖项。vaadin-bom还不够。

这在你的 pom.xml 中:

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-bom</artifactId>
            <version>8.0.3</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

<dependencies>
    <dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-server</artifactId>
    </dependency>
    <!-- other dependencies ... -->
</dependencies>
于 2017-03-23T10:39:29.867 回答