我想将Vaadin图表添加到我的项目中,我已经添加了maven依赖,安装许可证和vaadin干净,更新部件集和编译。但当我运行应用程序并打开localhost:8080时,在控制台中出现错误:
The widgetset in use does not seem to be built for the Vaadin
version in use. This might cause strange problems - a
recompile/deploy is strongly recommended.
Vaadin version: 8.0.0
Widgetset version: 8.0-SNAPSHOT并在UI上显示以下消息:https://www.screencast.com/t/deDF6kVsvDdU
下面是我的pom.xml中的vaadin依赖项:
<dependencies>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-spring-boot-starter</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-charts</artifactId>
<version>4.0.0</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>vaadin-addons</id>
<url>http://maven.vaadin.com/vaadin-addons</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<version>8.0.4</version>
<configuration>
<extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
<webappDirectory>${basedir}/target/classes/VAADIN/widgetsets</webappDirectory>
<draftCompile>false</draftCompile>
<compileReport>false</compileReport>
<style>OBF</style>
<strict>true</strict>
</configuration>
<executions>
<execution>
<goals>
<goal>update-theme</goal>
<goal>update-widgetset</goal>
<goal>compile</goal>
<goal>compile-theme</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>我该如何解决这个问题呢?
更新:以下是mvn vaadin:clean vaadin:compile的输出(运行此命令并不能解决我的问题):
[INFO] --- vaadin-maven-plugin:8.0.4:clean (default-cli) @ test ---
[WARNING] GWT plugin is configured to detect modules, but none were found.
[INFO]
[INFO] --- vaadin-maven-plugin:8.0.4:compile (default-cli) @ test ---
[WARNING] GWT plugin is configured to detect modules, but none were found.
[INFO] Using com.vaadin:vaadin-client version 8.0.0
[INFO] Using com.vaadin:vaadin-client-compiler version 8.0.0
[INFO] ---------------------------------------------------------------------
[INFO] BUILD SUCCESS 我还尝试向VaadinUI类添加注释@Widgetset("AppWidgetset")并重新编译,这一次我在UI上遇到错误:
Failed to load the widgetset: ./VAADIN/widgetsets/AppWidgetset/AppWidgetset.nocache.js?因此,我在VaadinUi类附近添加了WidgetSet.gwt.xml:
<?xml version="1.0" encoding="UTF-8"?>
<module>
<inherits name="com.vaadin.DefaultWidgetSet" />
<inherits name="com.vaadin.addon.charts.Widgetset" />
</module>重新编译所有代码,但仍然会得到
Failed to load the widgetset: ./VAADIN/widgetsets/AppWidgetset/AppWidgetset.nocache.js?发布于 2017-04-11 12:49:07
添加vaadin客户端dep
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client</artifactId>
<scope>provided</scope>
</dependency>发布于 2018-02-03 18:10:01
我的POM如下,它起作用了。正常的构建命令:mvn package。只需要编译一次小部件,所以当你构建你的应用程序时删除插件,以减少编译时间。要编译的VAADIN文件夹位于:\src\main\webapp\VAADIN
<!-- Only support to compile Vaadin widgetsets -->
.......
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-client</artifactId>
<scope>provided</scope>
<version>8.2.0</version>
</dependency>
.....
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<version>8.2.0</version>
<executions>
<execution>
<goals>
<goal>update-theme</goal>
<goal>update-widgetset</goal>
<goal>compile</goal>
<goal>compile-theme</goal>
</goals>
</execution>
</executions>
</plugin>https://stackoverflow.com/questions/43229136
复制相似问题