我想使用 Gradle 编译 Vaadin 7.6.2 项目,但编译小部件集时出现错误。
我正在使用 1.1.11
fi.jasoft.plugin.vaadin
的版本插入。 AppWidgetset.gwt.xml
文件位于 src/main/resources
文件夹。
查看日志文件,似乎问题与v-leaflet
有关模块:
...
[INFO] Compiling module AppWidgetset
[INFO] Tracing compile failure path for type 'org.vaadin.addon.leaflet.client.LeafletRectangleConnector'
[ERROR] Errors in 'jar:file:/C:/Users/admin/.gradle/caches/modules-2/files-2.1/org.vaadin.addon/v-leaflet/1.0.0-rc2/904f6ddbeebaa8136472941911bc214bebeb1dc5/v-leaflet-1.0.0-rc2.jar!/org/vaadin/addon/leaflet/client/LeafletRectangleConnector.java'
[ERROR] Line 17: No source code is available for type org.peimari.gleaflet.client.Layer; did you forget to inherit a required module?
[ERROR] Line 22: No source code is available for type org.peimari.gleaflet.client.Polygon; did you forget to inherit a required module?
[ERROR] Line 22: No source code is available for type org.peimari.gleaflet.client.PolylineOptions; did you forget to inherit a required module?
[ERROR] Line 26: No source code is available for type org.peimari.gleaflet.client.LatLngBounds; did you forget to inherit a required module?
...
以下是 build.gradle 的内容(vaadin 相关部分):
plugins {
...
id "fi.jasoft.plugin.vaadin" version "1.1.11"
}
...
dependencies {
...
compile group: 'com.vaadin', name: 'vaadin-spring-boot-starter', version:'1.0.0'
compile group: 'org.vaadin.spring.extensions', name: 'vaadin-spring-ext-core', version:'0.0.7.RELEASE'
compile group: 'org.vaadin.spring.extensions', name: 'vaadin-spring-ext-boot', version:'0.0.7.RELEASE'
compile group: 'org.vaadin.spring.extensions', name: 'vaadin-spring-ext-security', version:'0.0.7.RELEASE'
compile group: 'org.vaadin.spring.addons', name: 'vaadin-spring-addon-i18n', version:'0.0.7.RELEASE'
compile group: 'org.vaadin.spring.addons', name: 'vaadin-spring-addon-eventbus', version:'0.0.7.RELEASE'
compile group: 'org.vaadin', name: 'viritin', version:'1.44'
compile group: 'org.vaadin.addon', name: 'v-leaflet', version:'1.0.0-rc2'
compile(group: 'org.vaadin.addons', name: 'v-leaflet-markercluster', version:'1.0.0-b2') {
exclude(group: 'org.vaadin.addon', module: 'v-leaflet')
}
compile(group: 'org.vaadin.addon', name: 'v-leaflet-heat', version:'0.4') {
exclude(group: 'org.slf4j', module: 'slf4j-simple')
exclude(group: 'org.vaadin.addon', module: 'v-leaflet')
}
compile group: 'org.vaadin.addons', name: 'filteringtable', version:'0.9.15.v7'
compile group: 'com.vaadin.addon', name: 'vaadin-charts', version:'3.0.0'
compile group: 'com.vaadin.addon', name: 'vaadin-context-menu', version:'0.7.2'
compile group: 'org.vaadin.addons', name: 'vaadin-sliderpanel', version:'1.3.0'
compile group: 'eu.maxschuster', name: 'vaadin-autocompletetextfield', version:'1.0-alpha-4'
compile group: 'com.vaadin.addon', name: 'tableexport-for-vaadin', version:'1.6.2'
compile group: 'org.vaadin.teemu', name: 'switch', version:'2.0.3'
...
}
...
vaadin {
version '7.6.2'
}
我不知道为什么会发生错误,以前我使用的是 maven 并且一切正常。
最佳答案
从堆栈跟踪看来,v-leaflet 插件依赖于 g-leaflet,它似乎不在您的类路径中。
你可以尝试添加
compile group: 'org.peimari', name: 'g-leaflet', version: '1.0.4'
到你的构建,看看它是否有帮助。
关于gradle - 使用 Gradle 编译 Vaadin 小部件集,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44366780/