【问题标题】:Canvas addon with VAADIN 8, Gradle and SpringBoot带有 VAADIN 8、Gradle 和 SpringBoot 的画布插件
【发布时间】:2018-02-18 15:10:48
【问题描述】:

我是所有 Gradle、VAADIN 和 Spring 的新手,我正在学习一个简单的 VAADIN Spring Boot 教程 (https://spring.io/guides/gs/crud-with-vaadin/) 并尝试从 https://github.com/hezamu/vaadincanvas 添加 Canvas 插件,但是当我添加编译依赖

compile("org.vaadin.hezamu:canvas:2.3.0")

VAADIN 小部件编译将失败并出现大量奇怪的错误:

Using Gradle Vaadin Plugin 1.3.1
:vaadinPluginVersionCheck SKIPPED
:compileJava UP-TO-DATE
:vaadinUpdateWidgetset
:processResources UP-TO-DATE
:classes UP-TO-DATE
:vaadinClassPathJar UP-TO-DATE
Errors in 'jar:file:/C:/Users/msc/.gradle/caches/modules-2/files-2.1/com.vaadin/vaadin-client/8.1.8/93548adad170aea9fe62ab742908fe63fe0ec321/vaadin-client-8.1.8.jar!/com/vaadin/client/extensions/DragSourceExtensionConnector.java'
Line 413: The method getState() from the type DragSourceExtensionConnector refers to the missing type DragSourceState
Line 38: The import com.vaadin.shared.ui.dnd cannot be resolved
Line 433: DragSourceRpc cannot be resolved to a type
Line 605: DragSourceState cannot be resolved to a type
Line 39: The import com.vaadin.shared.ui.dnd cannot be resolved
Line 507: DragSourceRpc cannot be resolved to a type
Line 190: The method getState() from the type DragSourceExtensionConnector refers to the missing type DragSourceState
Line 433: The method getRpcProxy(Class<T>) in the type AbstractConnector is not applicable for the arguments (Class<DragSourceRpc>)
Line 212: DragSourceState cannot be resolved to a variable
Line 492: DropEffect cannot be resolved
Line 606: DragSourceState cannot be resolved to a type

只需删除一个依赖项,即可构建项目。这是整个 Gradle 构建文件:

buildscript {
    repositories {
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:1.5.10.RELEASE")
        classpath "com.devsoap.plugin:gradle-vaadin-plugin:1.3.1"
        classpath "javax.validation:validation-api:1.1.0.Final"
    }
}

plugins {
    id "com.devsoap.plugin.vaadin" version "1.3.1"
}

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
apply plugin: 'com.devsoap.plugin.vaadin'

jar {
    baseName = 'gs-crud-with-vaadin'
    version =  '0.1.0'
}

repositories {
    mavenCentral()
    maven { url "https://oss.sonatype.org/content/repositories/vaadin-snapshots" }
    maven { url "https://repository.jboss.org/nexus/content/repositories/releases" }
    maven { url "http://oss.sonatype.org/content/repositories/vaadin-snapshots/" }
    maven { url "http://vaadin.com/nexus/content/repositories/vaadin-addons/" }
    maven { url "https://plugins.gradle.org/m2/" }
}

sourceCompatibility = 1.8
targetCompatibility = 1.8

dependencyManagement {
  imports {
    mavenBom 'com.vaadin:vaadin-bom:8.0.0'
  }
}

dependencies {
    compile("org.springframework.boot:spring-boot-starter-data-jpa")
    compile("com.vaadin:vaadin-spring-boot-starter")
    compile("org.springframework.boot:spring-boot-starter-actuator")
    compile("org.vaadin.hezamu:canvas:2.3.0")
    compile("com.h2database:h2")
    testCompile("junit:junit")
    testCompile("org.springframework.boot:spring-boot-starter-test")
}

我做错了什么?我正在使用 Gradle 4.1 和 Java 8。

【问题讨论】:

    标签: java canvas gradle widget vaadin


    【解决方案1】:

    您的 vaadin 版本有问题。你有一个 8.0.0 的 bom,但我猜 gradle 插件会尝试使用更新的版本(8.1.8)。

    在 Vaadin 8.1 中,拖放处理发生了变化。我猜这个插件不支持 Vaadin 8.1,因为它之前发布过。

    您有三个选择。

    1. 尽可能使用其他插件。
    2. 自己修复插件
    3. 或者作为最后的手段,将以下代码添加到您的构建 gradle 以留在 Vaadin 8.0

      vaadin { 版本“8.0.7” }

    【讨论】:

      【解决方案2】:

      嗯,我在“微调”所有版本后让它工作。 VAADIN,它的插件和 Gradle 似乎是一个善变的团队。它适用于 spring-boot gradle 插件 1.4.7.RELEASE(重要!)、VAADIN 8.1.1、devsoap VAADIN Gradle 插件 1.3.1、multifileupload 插件 3.0.1 和 canvas 插件 2.2.0。

      这些版本中的任何一个几乎都发生了任何变化,并且有些东西崩溃了。

      【讨论】:

        猜你喜欢
        • 2015-11-14
        • 2017-04-10
        • 2019-03-25
        • 1970-01-01
        • 1970-01-01
        • 2023-03-28
        • 2013-01-05
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多