我是Grails和Vaadin 8领域的新手,我在尝试将小部件添加到我的Vaadin / Grails应用程序时遇到了一些麻烦。
首先,我使用me.przepiora.vaadin-grails创建了一个grails / Vaadin应用程序:web-vaadin8:0.3 profile。我按照建议编辑了build.gradel文件 运行命令“gradle wrapper --gradle-version 4.0”(再次,如配置文件设置所示)。
应用编辑后,这是我的build.gradle:
apply plugin:"com.devsoap.plugin.vaadin"
buildscript {
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
maven { url "https://dl.bintray.com/macprzepiora/gradle-plugins/" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
classpath "org.grails.plugins:hibernate5:${gormVersion-".RELEASE"}"
classpath "com.devsoap.plugin:gradle-vaadin-plugin:1.2.0.beta1-macprzepiora2"
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.14.8"
}
}
version "0.1"
group "foobar"
apply plugin:"eclipse"
apply plugin:"idea"
apply plugin:"war"
apply plugin:"org.grails.grails-web"
apply plugin:"asset-pipeline"
apply plugin:"org.grails.grails-gsp"
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
compile "org.springframework.boot:spring-boot-starter-logging"
compile "org.springframework.boot:spring-boot-autoconfigure"
compile "org.grails:grails-core"
compile "org.springframework.boot:spring-boot-starter-actuator"
compile "org.springframework.boot:spring-boot-starter-tomcat"
compile "org.grails:grails-web-boot"
compile "org.grails:grails-logging"
compile "org.grails:grails-plugin-rest"
compile "org.grails:grails-plugin-databinding"
compile "org.grails:grails-plugin-i18n"
compile "org.grails:grails-plugin-services"
compile "org.grails:grails-plugin-url-mappings"
compile "org.grails:grails-plugin-interceptors"
compile "org.grails.plugins:cache"
compile "org.grails.plugins:async"
compile "org.grails.plugins:scaffolding"
compile "com.vaadin:vaadin-spring-boot-starter:2.+"
compile "org.grails.plugins:events"
compile "org.grails.plugins:hibernate5"
compile "org.hibernate:hibernate-core:5.1.5.Final"
compile "org.grails.plugins:gsp"
console "org.grails:grails-console"
profile "me.przepiora.vaadin-grails:web-vaadin8:0.3"
runtime "org.glassfish.web:el-impl:2.1.2-b03"
runtime "com.h2database:h2"
runtime "org.apache.tomcat:tomcat-jdbc"
runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.14.8"
testCompile "org.grails:grails-gorm-testing-support"
testCompile "org.grails:grails-web-testing-support"
}
bootRun {
jvmArgs('-Dspring.output.ansi.enabled=always')
addResources = true
String springProfilesActive = 'spring.profiles.active'
systemProperty springProfilesActive, System.getProperty(springProfilesActive)
}
plugins {
id 'com.devsoap.plugin.vaadin' version '1.3.1'
}
assets {
minifyJs = true
minifyCss = true
}
生成的grails / Vaadin应用程序工作正常,显示一个按钮,按下该按钮时会显示错误消息。 然后,我尝试通过用Vaadin树替换按钮,通过TreeData实例进行备份来略微增强应用程序。
不幸的是,当我这样做时,我收到了错误消息:
“Widgetset' com.vaadin.DefaultWidgetSet'不包含com.vaadin.ui.Tree的实现检查其组件连接器的@Connect映射,widgetsets GWT模块描述文件并重新编译您的widgetset。如果您下载了vaadin附加软件包,则可能需要参考附加说明。“
在谷歌搜索后,我发现了一些似乎与之相关的内容:
基于此,我将行@Widgetset(" AppWidgetset")添加到我的GrailsUI类(我的项目中唯一继承自com.vaadin.ui.UI的类)。
执行此操作后,我收到一个新的运行时错误:
“无法加载小部件集:./ VAADIN / widgetsets / AppWidgetset / AppWidgetset.nocache.js?1525623851485”
我感到非常沮丧 - 感觉我真的很接近一个正在运作的应用程序,只要我知道魔法咒语: - (