Migration from v7 to v8. Cannot package for production.

Dear Community

I’m trying to migrate our application from Vaadin 7 to Vaadin 8.4.5
Everything has gone fine and I could clean out every error I got on the migration.
I followed some tutorials and got inputs from the forums.

But I have never been able to do a “mvn -Pproduction package”
It fails everytime with the known message:

Failed to execute goal com.vaadin:vaadin-maven-plugin:8.4.5:compile (default) on project vaadin-app-production: GWT Module com.vaadin.v7.Vaadin7WidgetSet not found in project sources or resources. -> [Help 1]

So I tried to create a new Vaadin 8.4.5 Project from archetype “vaadin-archetype-application-example” which is the one I used on v7 also.
Then changed dependency “vaadin-server” to “vaadin-compatibility-server” (in app-ui module) and “vaadin-client” to “vaadin-compatibility-client” (in app-widgetset module)
I can do a “mvn clean install” without any problems. I can debug an test the application with jetty:run. So everything seems fine. But now I can’t do a “mvn -Pproduction package” anymore. It ends with the same error.

Is there anything special to obey with the migration of a MultiModule Vaadin application? It seems I am missing something.

Thank you very much for your help

Daniel

Possible Solution:
Namely either in their main module app widgetset should inherit com.vaadin.v7.Vaadin7WidgetSet or if they have custom client side in the app, i.e. client module, there the widgetset should inherit com.vaadin.v7.Vaadin7WidgetSet.

My Response:
I did not understand. Here some more details:

I created the test Application with Maven Archetype vaadin-archetype-application-example. So I have:
app-backend
app-ui
app-production
app-widgetset

In app-ui in MyUI.class there is the annotation:
@Widgetset(“org.test.MyAppWidgetset”)

In app-widgetset the file MyAppWidgetset.gwt.xml looks like this

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.8.1//EN" "http://gwtproject.org/doctype/2.8.1/gwt-module.dtd">
<module>
    <inherits name="com.vaadin.DefaultWidgetSet"/>
    
    <stylesheet src="resetbuttonfortextfield/styles.css"/>

    <inherits name="com.vaadin.v7.Vaadin7WidgetSet" />
</module>

So there is com.vaadin.v7.Vaadin7WidgetSet
This is automatically enhanced when I change „vaadin-client“ to „vaadin-compaibility-client“ in the app-widgetset/pom.xml.

I also changed „vaadin-server“ to „vaadin-compatibility-server“ in the app-ui/pom.xml

If I do a „mvn clean install“ everything works fine and the Widgetset gets compiled. But if I do a „mvn –Pproduction package“ then the process aborts trying to compile the widgetset with the message about vaadin7Widgetset not found.

Maybe you can help me with some more details too
Thank you

Hi!

Could you post your pom.xml and attach your compiled widgetsets (when you build with mvn clean install)?
Another question is do you use vaadin-client-compiler dependency?

Bye, Károly

Hi Karoly

Thank you very much for your response. As for the pom.xml and widgetset. You can easily reproduce it by creating a new Sample CRUD Project with

mvn -B archetype:generate -DarchetypeGroupId="com.vaadin" -DarchetypeArtifactId="vaadin-archetype-application-example" -DarchetypeVersion="8.4.5" -DgroupId="org.test" -DartifactId="vaadin-app" -Dversion="1.0-SNAPSHOT"

“mvn clean install” and also “mvn -Pproduction package” work fine now.

Then change vaadin-server to vaadin-compatibility-server in the UI module
and vaadin-client to vaadin-compatibility-client in the Widgetset module

After that “mvn clean install” works completly fine but “mvn -Pproduction package” end with the error.

Thanks again for your help

Daniel

Hi everyone…

I really didn’t see it anymore. Well, now it’s working.
In a multi module application it is needed to also add “vaadin-compatibility-client” dependency into “app-production/pom.xml” to get the production war built with “mvn -Pproduction package”

In a Full Debug Log (-X switch with mvn) I have seen, that the production build was still using “vaadin-client” instead of “vaadin-compatibility-client”

So Thanks everyone for the help

Daniel