0

我尝试在我的 maven 项目中使用带有最新版本 Vaadin 的Tree() 方法和 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>

这是错误: 在此处输入图像描述

我应该怎么做才能在最新版本的 Vaadin 上使用 Tree() 并解决此错误?

4

1 回答 1

4

Tree组件尚未完全准备好用于 Vaadin 8。vaadin-compatibility-server如果你想使用它,你必须使用它。

<dependency>
    <groupId>com.vaadin</groupId>
    <artifactId>vaadin-compatibility-server</artifactId>
    <version>8.0.2</version>
</dependency>
于 2017-03-17T06:05:09.460 回答