Migrate to vaadin 8

Since Vaadin 7 will no more supported in 2019 I need to migrate to a newer version of the library. I migrated to Vaadin 8 in mhu-lib 3.4.0, mhu-osgi-tools 1.4.3 and mhu-ports 1.3.6.

The new version no more supports tables (I will discuss pro and contra in another post) but a set of legacy packages will do it for the moment. There are also some other changes but they are more or less handy.
 
The migration of the application can be done by a tool. The tool will modify all java imports to the new - correct - packages. I was using the standalone tool (alternatively you can use a maven goal). Download the sources from https://github.com/vaadin/framework8-migration-tool and compile the project afterwards you can use the jar file to migrate your projects. Change location into your project home directory and execute the jar file

java -jar $HOME/.m2/repository/com/vaadin/framework8-migration-tool/8.0-SNAPSHOT/framework8-migration-tool-8.0-SNAPSHOT.jar

If you use maven you need to change the version number of the vaadin dependencies and also add for each dependency a corresponding legacy (compatibility) dependency.

<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-compatibility-shared</artifactId>
<version>${vaadin.version}</version>
</dependency>
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-compatibility-client</artifactId>
<version>${vaadin.version}</version>
</dependency>
[...]

There are some small changes...

  • Instead of component.getValue() you need to use ((HasValue)component).getValue()
  • If using the deprecated version 7 components you need to use the widgetset com.vaadin.v7.Vaadin7WidgetSet
And also a new dependency is needed

<!-- https://mvnrepository.com/artifact/org.jsoup/jsoup -->
<dependency>
    <groupId>org.jsoup</groupId>
    <artifactId>jsoup</artifactId>
    <version>1.11.3</version>
</dependency>

install -s mvn:org.jsoup/jsoup/1.11.3



Comments

Popular posts from this blog

vaadin 14 with osgi and karaf

uptime command for karaf

Split mhus-osgi-tools and create mhu-liferay-tools