Build fails after upgrading from Vaadin 7 8

2019-07-27 06:05发布

问题:

I just upgraded from Vaadin 7 to 8. We were on 7.7.7 and now we are on 8.0.3. My IDE shows no compile time errors but when I run mvn package I see the following error..

[INFO] --- vaadin-maven-plugin:8.0.3:compile (default) @ eagleportal ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 25.728 s
[INFO] Finished at: 2017-03-22T18:19:55-06:00
[INFO] Final Memory: 22M/142M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.vaadin:vaadin-maven-plugin:8.0.3:compile (default) on project eagleportal: GWT Module com.vaadin.terminal.gwt.DefaultWidgetSet not found in project sources or resources. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

My maven config for the Vaadin compiler looks like this

    <plugin>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-maven-plugin</artifactId>
        <version>${vaadin.plugin.version}</version>
        <configuration>
            <extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
            <!-- <runTarget>mobilemail</runTarget> -->
            <!-- We are doing "inplace" but into subdir VAADIN/widgetsets. This
                way compatible with Vaadin eclipse plugin. -->
            <webappDirectory>${basedir}/src/main/webapp/VAADIN/widgetsets</webappDirectory>
            <hostedWebapp>${basedir}/src/main/webapp/VAADIN/widgetsets</hostedWebapp>
            <noServer>true</noServer>
            <!-- Remove draftCompile when project is ready -->
            <draftCompile>false</draftCompile>
            <compileReport>true</compileReport>
            <style>OBF</style>
            <runTarget>http://localhost:8080/</runTarget>
            <warSourceDirectory>${basedir}/src/main/webapp</warSourceDirectory>
        </configuration>
        <executions>
            <execution>
                <configuration>
                    <modules>
                        <module>com.eaglecopter.portal.EaglePortal</module>
                        <module>com.eaglecopter.portal.EaglePortalMobile</module>
                    </modules>
                </configuration>
                <phase>generate-resources</phase>
                <goals>
                    <goal>clean</goal>
                    <goal>resources</goal>
                    <goal>update-theme</goal>
                    <goal>update-widgetset</goal>
                    <goal>compile-theme</goal>
                    <goal>compile</goal>
                </goals>
            </execution>
        </executions>
    </plugin>

回答1:

Your application widgetset or some add-on that you are using is still pointing to V6 era com.vaadin.terminal.gwt.DefaultWidgetSet. If the re is a direct reference to that in your applications .gwt.xml files, switch that to com.vaadin.DefaultWidgetSet.

If there are some add-ons that try to bring it in, upgrade those to Vaadin 8 compatible versions. If no V8 compatible version is out yet, I'll need to help the maintainer to upgrade or try to manage without the add-on.