Vaadin最新版本中的树组件不起作用

时间:2017-03-17 01:20:29

标签: java maven vaadin spring-boot-test

我尝试在我的maven项目中使用Tree() method和Vaadin的最后一个版本使用spring-boot创建一个下拉菜单,但我无法导入正确的包。

我只是在我的pom.xml文件中有这些依赖项:

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.2.RELEASE</version>
    </parent>
    <groupId>spring.boot.vaadin.admin</groupId>
    <artifactId>spring.boot.vaadin.admin.ui</artifactId>
    <version>0.0.1-SNAPSHOT</version>
   <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-spring-boot-starter</artifactId>
            <version>2.0.0</version>
        </dependency>
    </dependencies>
    <properties>
        <java.version>1.8</java.version>
    </properties>
    <build>
        <sourceDirectory>src/main/java</sourceDirectory>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <executable>true</executable>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                    <warName>spring-boot-vaadin-admin-ui-components</warName>
                </configuration>
            </plugin>
        </plugins>
        <finalName>spring-boot-vaadin-admin-ui-components</finalName>
    </build>
    <packaging>war</packaging>
</project>

这是错误:   enter image description here

如何在最新版本的Vaadin上使用Tree()并解决此错误?

1 个答案:

答案 0 :(得分:4)

Tree组件尚未为Vaadin 8做好充分准备。如果要使用它,必须使用vaadin-compatibility-server包。

<dependency>
    <groupId>com.vaadin</groupId>
    <artifactId>vaadin-compatibility-server</artifactId>
    <version>8.0.2</version>
</dependency>