我正在使用 vaadin-maven-plugin:8.1.2 因为我希望拥有与默认套件不同的widgetset。 当我编译widgetset(通过Vaadin eclipse插件)时,我得到了这个:
[INFO] No widgetsets found - generating AppWidgetset if necessary.
[INFO] Updating widgetset AppWidgetset
[INFO] Adding resource directory to command classpath:
C:\Users\myUser\eclipse-workspace\jpex\src\main\resources
[INFO] Adding resource directory to command classpath:
C:\Users\myUser\eclipse-workspace\jpex\src\main\resources
[INFO] Adding resource directory to command classpath:
C:\Users\myUser\eclipse-workspace\jpex\target\generated-resources\gwt
[INFO] Using com.vaadin:vaadin-client version 8.1.2
[INFO] Using com.vaadin:vaadin-client-compiler version 8.1.2
[INFO] Widgetsets found from classpath:
[INFO] org.vaadin.sliderpanel.WidgetSet in jar:file:C:/Users/myUser/.m2/repository/org/vaadin/addons/vaadin-sliderpanel/2.0.0/vaadin-sliderpanel-2.0.0.jar!/
[INFO] com.vaadin.DefaultWidgetSet in jar:file:C:/Users/myUser/.m2/repository/com/vaadin/vaadin-client/8.1.2/vaadin-client-8.1.2.jar!/
[INFO] Addon styles found from classpath:
[INFO]
[INFO] Search took 10ms
[INFO]
[INFO] --- vaadin-maven-plugin:8.1.2:compile (default-cli) @ jpex ---
[INFO] auto discovered modules [AppWidgetset]
[INFO] Using com.vaadin:vaadin-client version 8.1.2
[INFO] Using com.vaadin:vaadin-client-compiler version 8.1.2
[INFO] Loading inherited module 'AppWidgetset'
[INFO] [ERROR] Unable to find 'AppWidgetset.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.298 s
[INFO] Finished at: 2017-08-28T14:31:51+02:00
[INFO] Final Memory: 30M/448M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.vaadin:vaadin-maven-plugin:8.1.2:compile (default-cli) on project jpex: Command [[
[ERROR] C:\Program Files\Java\jre1.8.0_141\bin\java -Xmx512M -Xss1024k -Dgwt.persistentunitcache=false com.google.gwt.dev.Compiler -logLevel INFO -style OBF -war C:\Users\myUser\eclipse-workspace\jpex\target\classes\VAADIN\widgetsets -localWorkers 8 -failOnError -XfragmentCount -1 -sourceLevel auto -gen C:\Users\myUser\eclipse-workspace\jpex\target\.generated AppWidgetset
[ERROR] ]] failed with status 1
首先,我想问一下如何强制插件使用它:org.vaadin.sliderpanel.WidgetSet
?它一直在尝试编译com.vaadin:vaadin-client version
AppWidgetset.gwt.xml是在target / generated-resources / gwt中自动创建的,我实际上想要生成的继承,但不知何故插件无法找到它。
这是我的web.xml文件:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0">
<display-name>jpex</display-name>
<servlet>
<servlet-name>Servlet</servlet-name>
<servlet-class>com.vaadin.spring.server.SpringVaadinServlet</servlet-class>
<init-param>
<param-name>UI</param-name>
<param-value>com.myProject.jpex.ui.JpexUI</param-value>
</init-param>
<init-param>
<param-name>widgetset</param-name>
<param-value>org.vaadin.sliderpanel.WidgetSet</param-value>
</init-param>
</servlet>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>
从pom.xml构建部件
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<version>${vaadin.plugin.version}</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>
</pluginManagement>
</build>
答案 0 :(得分:1)
我花了几个小时处理它,只是将生成的AppWidgetset.gwt.xml文件放到src / main / resources。