java - Vaadin 小部件集编译失败

标签 java maven vaadin

我使用 vaadin-maven-plugin:8.1.2 因为我想要拥有与默认不同的小部件集。 当我编译 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>

最佳答案

我花了几个小时来处理它,当时只是将生成的 AppWidgetset.gwt.xml 文件放入 src/main/resources。

关于java - Vaadin 小部件集编译失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45919574/

相关文章:

java - Android 用光标填充 ListView

maven-2 - Maven-替换Jar中的文件

Java Eclipse 通过 Tomcat 连接 MySQL

java - 如何获取计算机时间而不是服务器 Java vaadin

java - 小程序中的单例

java - 为什么Java中的文件名与公共(public)类名相同?

maven - 从 Maven pom.xml 更新 sonar-project.properties 文件中的特定属性?

java - 从 java 中调用 javascript 函数

java - 如何在服务器中找到 JMX 端口?

maven-2 - 您知道 mvnrepository.com 的 Maven 配置文件吗?