【发布时间】: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