0

I am trying to import com.vaadin.shared.ui.JavaScriptComponentState. I used this import in vaadin 7, but when I update to vaadin 8 I can't do this anymore. I am using vaadin bom 8.0.3 in the pom. Any hints what I am doing wrong here?

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;
   }
}

Error:

The import com.vaadin.shared.ui.JavaScriptComponentState cannot be resolved
hhwwww
  • 83
  • 1
  • 2
  • 12

1 Answers1

1

Your pom.xml must have the vaadin-server dependency. The vaadin-bom is not enough.

This goes in your 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>
Axel Meier
  • 1,105
  • 2
  • 18
  • 28