首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >带有VAADIN8、Gradle和SpringBoot的Canvas插件

带有VAADIN8、Gradle和SpringBoot的Canvas插件
EN

Stack Overflow用户
提问于 2018-02-18 23:10:49
回答 2查看 366关注 0票数 0

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

代码语言:javascript
复制
compile("org.vaadin.hezamu:canvas:2.3.0")

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

代码语言:javascript
复制
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构建文件:

代码语言:javascript
复制
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。

EN

回答 2

Stack Overflow用户

发布于 2018-02-19 17:11:24

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

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

您有三个选择。

如果可能,

  1. 使用一些其他插件。
  2. 修复自己的插件
  3. ,或者作为最后的手段,将以下代码添加到您的构建gradle中以停留在Vaadin8.0中

vaadin {版本'8.0.7‘}

票数 0
EN

Stack Overflow用户

发布于 2018-02-21 05:34:04

嗯,在对所有版本进行“微调”之后,我让它正常工作了。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。

这些版本中几乎任何一个版本的任何更改,都会导致一些东西崩溃。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48853154

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档