如何配置Vaadin项目以使用Vaadin-spring-boot-starter和最新的Vaadin框架

时间:2017-07-19 17:10:51

标签: maven spring-boot vaadin vaadin8 vaadin4spring

我根据最新的Vaadin Spring启动版本2.0.1定义了我的项目,如下所示。 我想使用最新的Vaadin框架版本8.1.0.rc2(今天发布)来使用Tree和新的拖放功能。是否可以保留spring boot版本但在Maven中使用新的Vaadin功能?

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.5.3.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.version>1.8</java.version>
    <vaadin.version>8.1.0.rc2</vaadin.version>
</properties>

<dependencies>
    <dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-spring-boot-starter</artifactId>
        <version>2.0.1</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.gdl2</groupId>
        <artifactId>gdl2</artifactId>
        <version>0.3.20</version>
    </dependency>

    <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>19.0</version>
    </dependency>

    <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>1.2.3</version>
    </dependency>

    <dependency>
        <groupId>org.openehr.adl2-core</groupId>
        <artifactId>adl-parser</artifactId>
        <version>1.3.8</version>
    </dependency>

</dependencies>

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

1 个答案:

答案 0 :(得分:4)

问题是我应该更改存储库,因为我想使用预发布版本。为此,应将以下行添加到pom文件中的存储库:

<pluginRepositories>
    <pluginRepository>
        <id>vaadin-prereleases</id>
        <name>Vaadin Pre-releases</name>
        <url>https://maven.vaadin.com/vaadin-prereleases</url>
    </pluginRepository>

</pluginRepositories>
<repositories>
    <repository>
        <id>vaadin-prereleases</id>
        <name>Vaadin Pre-releases</name>
        <url>https://maven.vaadin.com/vaadin-prereleases</url>
    </repository>
    <repository>
        <id>vaadin-addons</id>
        <url>http://maven.vaadin.com/vaadin-addons</url>
    </repository>
</repositories>

除此之外,应添加以下依赖项:

<!-- ===============================Spring dependency======================================= -->
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-test</artifactId>
    <scope>test</scope>
</dependency>

<!-- ============================Vaadin dependencies=============================== -->
<dependency>
    <groupId>com.vaadin</groupId>
    <artifactId>vaadin-spring-boot-starter</artifactId>
    <version>2.0.1</version>
</dependency>
<dependency>
    <groupId>com.vaadin</groupId>
    <artifactId>vaadin-themes</artifactId>
    <version>${vaadin.version}</version>
</dependency>
<dependency>
    <groupId>com.vaadin</groupId>
    <artifactId>vaadin-client-compiled</artifactId>
    <version>${vaadin.version}</version>
</dependency>

最后一件事是版本属性:

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.version>1.8</java.version>
    <vaadin.version>8.1.0.rc2</vaadin.version>
</properties>