Update a Vaadin 10 project to Vaadin 11 beta?

I see in the documentation site:

https://vaadin.com/docs/v11

…that there must be a version 11 beta available. I cannot find any information about a specific version number or other Maven info.

How can I take an existing Version 10 project and update to a Version 11 pre-release?

Is there some Flow “Releases” page as there is for Framework “Releases” (v8)?
https://vaadin.com/framework/releases

https://github.com/vaadin/platform/releases

Basil,

You can find the BOM for prereleaes here:

https://maven.vaadin.com/vaadin-prereleases/com/vaadin/vaadin-bom/

In order to use a prerelease in your project, ensure that you have the prerelease repository defined:

<repositories>
	<repository>
		<id>vaadin-prereleases</id>
		<url>https://maven.vaadin.com/vaadin-prereleases</url>
	</repository>
	...
</repositories>

And then define the release to use in your properties:

<properties>
    ...
	<!-- Dependencies -->
	<vaadin.version>11.0.0.alpha1</vaadin.version>
	...
</properties>

Martin Israelsen:
https://maven.vaadin.com/vaadin-prereleases

Nope. That site has XML data listings for pre-release versions of Vaadin 7 and Vaadin 8, but none for Flow (versions 10, 11, 12, and so on).

See for yourself: https://maven.vaadin.com/vaadin-prereleases/archetype-catalog.xml

Basil,

Try this URL: https://maven.vaadin.com/vaadin-prereleases/com/vaadin/vaadin-bom/

Martin Israelsen:
Basil,

Try this URL: https://maven.vaadin.com/vaadin-prereleases/com/vaadin/vaadin-bom/

Can you provide more instructions on how to use that to set up a project for Vaadin 12?

Should I be copying over the pre-release profile part of a Vaadin 8 POM file? Or is there a better way?

Basil,

As far as I remember, all you need to do is to add the maven pre-releases repository to your POM and then change the vaadin version:

    <properties>
	    ...
        <!-- Dependencies -->
        <vaadin.version>12.0.0.alpha5</vaadin.version>
		...
	</properties>

    <repositories>
        <repository>
            <id>vaadin-prereleases</id>
            <url>https://maven.vaadin.com/vaadin-prereleases</url>
        </repository>

        <repository>
            <id>vaadin-addons</id>
            <url>http://maven.vaadin.com/vaadin-addons</url>
        </repository>
		...

This obviously requires that you have a working Vaadin 10 maven project. See https://vaadin.com/start/latest

Martin Israelsen:
Basil,

Try this URL: https://maven.vaadin.com/vaadin-prereleases/com/vaadin/vaadin-bom/

Nope, that URL is not a proper Maven repository. Results in an error when IntelliJ invokes Maven to update its repositories, as shown in attached screenshot.

17368806.png

Hi Basil,

For Maven, use the URL from the POM example above

        <repository>
            <id>vaadin-prereleases</id>
            <url>https://maven.vaadin.com/vaadin-prereleases</url>
        </repository>

        <repository>
            <id>vaadin-addons</id>
            <url>http://maven.vaadin.com/vaadin-addons</url>
        </repository>

Martin Israelsen:
Hi Basil,

For Maven, use the URL from the POM example above

        <repository>
            <id>vaadin-prereleases</id>
            <url>https://maven.vaadin.com/vaadin-prereleases</url>
        </repository>
        

Nope. As I said above, that URL leads to [an XML file]
(https://maven.vaadin.com/vaadin-prereleases/archetype-catalog.xml) that contains data for Vaadin 7 & 8, but not 10 and later.

Martin Israelsen:
Hi Basil,

For Maven, use the URL from the POM example above

        <repository>
            <id>vaadin-prereleases</id>
            <url>https://maven.vaadin.com/vaadin-prereleases</url>
        </repository>
  

Nope. As I said above, that URL leads to [an XML file]
(https://maven.vaadin.com/vaadin-prereleases/archetype-catalog.xml) that contains data for Vaadin 7 & 8, but not 10 and later.

So this POM:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns = "http://maven.apache.org/POM/4.0.0"
         xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation = "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.basilbourque.acmekit</groupId>
    <artifactId>acmekit</artifactId>
    <name>Bogus</name>
    <version>1.0-SNAPSHOT</version>
    <packaging>war</packaging>

    <properties>
        <maven.compiler.source>10</maven.compiler.source>
        <maven.compiler.target>10</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <failOnMissingWebXml>false</failOnMissingWebXml>

        <!--<vaadin.version>11.0.1</vaadin.version>-->
        <vaadin.version>12.0.0alpha5</vaadin.version>
    </properties>

    <repositories>
        <!-- Repository used by many Vaadin add-ons -->
        <repository>
            <id>Vaadin Directory</id>
            <url>http://maven.vaadin.com/vaadin-addons</url>
        </repository>

        <repository>
            <id>vaadin-prereleases</id>
            <url>https://maven.vaadin.com/vaadin-prereleases</url>
        </repository>

    </repositories>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-bom</artifactId>
                <type>pom</type>
                <scope>import</scope>
                <version>${vaadin.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-core</artifactId>
        </dependency>

        <!-- Added to provide logging output as Flow uses -->
        <!-- the unbound SLF4J no-operation (NOP) logger implementation -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!-- Jetty plugin for easy testing without a server -->
            <plugin>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>9.4.11.v20180605</version>
                <configuration>
                    <scanIntervalSeconds>1</scanIntervalSeconds>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <!-- Production mode can be activated with either property or profile -->
            <id>production-mode</id>
            <activation>
                <property>
                    <name>vaadin.productionMode</name>
                </property>
            </activation>
            <properties>
                <vaadin.productionMode>true</vaadin.productionMode>
            </properties>

            <dependencies>
                <dependency>
                    <groupId>com.vaadin</groupId>
                    <artifactId>flow-server-production-mode</artifactId>
                </dependency>
            </dependencies>

            <build>
                <plugins>
                    <plugin>
                        <groupId>com.vaadin</groupId>
                        <artifactId>vaadin-maven-plugin</artifactId>
                        <version>${vaadin.version}</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>copy-production-files</goal>
                                    <goal>package-for-production</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>

… when doing a Maven clean results in this error:

/Library/Java/JavaVirtualMachines/zulu-10.jdk/Contents/Home/bin/java -Dmaven.multiModuleProjectDirectory=/Users/basilbourque/IdeaProjects/AcmeKit -Dmaven.home=/Users/basilbourque/Documents/Tools/Maven/apache-maven-3.5.4 -Dclassworlds.conf=/Users/basilbourque/Documents/Tools/Maven/apache-maven-3.5.4/bin/m2.conf "-javaagent:/Applications/IntelliJ IDEA 2018.3 EAP.app/Contents/lib/idea_rt.jar=65077:/Applications/IntelliJ IDEA 2018.3 EAP.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath /Users/basilbourque/Documents/Tools/Maven/apache-maven-3.5.4/boot/plexus-classworlds-2.5.2.jar org.codehaus.classworlds.Launcher -Didea.version=2018.3 clean
[INFO]
 Scanning for projects...
[ERROR]
 [ERROR]
 Some problems were encountered while processing the POMs:
[ERROR]
 Non-resolvable import POM: Failure to find com.vaadin:vaadin-bom:pom:12.0.0alpha5 in http://maven.vaadin.com/vaadin-addons was cached in the local repository, resolution will not be reattempted until the update interval of Vaadin Directory has elapsed or updates are forced @ line 35, column 21
[ERROR]
 'dependencies.dependency.version' for com.vaadin:vaadin-core:jar is missing. @ line 46, column 17
[ERROR]
 'dependencies.dependency.version' for org.slf4j:slf4j-simple:jar is missing. @ line 53, column 17
 @ 
[ERROR]
 The build could not read 1 project -> [Help 1]

[ERROR]
   
[ERROR]
   The project com.basilbourque.acmekit:acmekit:1.0-SNAPSHOT (/Users/basilbourque/IdeaProjects/AcmeKit/pom.xml) has 3 errors
[ERROR]
     Non-resolvable import POM: Failure to find com.vaadin:vaadin-bom:pom:12.0.0alpha5 in http://maven.vaadin.com/vaadin-addons was cached in the local repository, resolution will not be reattempted until the update interval of Vaadin Directory has elapsed or updates are forced @ line 35, column 21 -> [Help 2]

[ERROR]
     'dependencies.dependency.version' for com.vaadin:vaadin-core:jar is missing. @ line 46, column 17
[ERROR]
     'dependencies.dependency.version' for org.slf4j:slf4j-simple:jar is missing. @ line 53, column 17
[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/ProjectBuildingException
[ERROR]
 [Help 2]
 http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

Process finished with exit code 1

Hi Basil,

Not quite sure what is causing that error. I’m using the same repository settings that you have in your example and I tried switching to 12.0.0.alpha5, and it compiled just fine here, both on command line and in Eclipse.

Hi Basil, I just noticed one thing that, the version you used is <vaadin.version>12.0.0alpha5</vaadin.version> which is not correct… because it should be 12.0.0.alpha5 and you are missing a dot. By the way, the 12.0.0.beta1 has been released recently. so you can also try that.

Zhe Sun:
…By the way, the 12.0.0.beta1 has been released recently. so you can also try that.

➥ How do you know what versions have been released?

I can find no such listing for Vaadin Flow. My only indication has been the version displayed in the JavaDoc:

https://vaadin.com/api/platform/12.0.0.alpha5/overview-summary.html

…which currently is still at alpha5.

Close but no cigar.

After doing these steps:

(1) Add this element to the <repositories> element:

<repository>
    <id>vaadin-prereleases</id>
    <url>https://maven.vaadin.com/vaadin-prereleases</url>
</repository>

(2) Change this element:

<vaadin.version>11.0.1</vaadin.version>

…to this element:

<vaadin.version>12.0.0.beta1</vaadin.version>

(3) Run a Maven clean.

(4) Run a Maven install.

… I do get Vaadin 12 beta 1, and the app actually runs, but my POM now reports an error:

Plugin 'com.vaadin:vaadin-maven-plugin:12.0.0.beta1' not found

In the attachment screenshot, notice (a) the vaadin-core library is updated to 12.0.0.beta1 successfully, and (b) error message floating over the <version>${vaadin.version}</version> element.

17370769.jpg

Hello Basil. One of the easiest ways of seeing what is released is to subscribe to the github release notes for the platform https://github.com/vaadin/platform/releases. The javadocs for V12 beta1 will be online on the website soon.

The issue you’re having is that you’re missing the <pluginRepository> from your pom.xml. You need to add the vaadin-prereleases repository there too, as for some reason those are defined separately in Maven.

    <pluginRepositories>
        <!-- Repository needed for prerelease versions of Vaadin -->
        <pluginRepository>
            <id>vaadin-prereleases</id>
            <url>https://maven.vaadin.com/vaadin-prereleases</url>
        </pluginRepository>
    </pluginRepositories>

I recommend that whenever you’re in doubt about what should be in the pom.xml or when you’re starting a new project, you take one of the project bases from the vaadin.com/start to get everything setup like it should, or you can use those as examples for your project to see what you might be missing. All the free starters are also available on github: https://github.com/vaadin/skeleton-starter-flow/blob/master/pom.xml

Pekka Hyvönen:
…when you’re starting a new project, you take one of the project bases from the vaadin.com/start to get everything setup like it should,

That is indeed just what I did, with no problem.

The problem is in trying to modify that given starter project to use the alpha/beta versions. I have yet to use the alpha/beta successfully. As shown in my previous message above, I can run 12.0.0.beta1 but with a POM error: Plugin 'com.vaadin:vaadin-maven-plugin:12.0.0.beta1' not found

Did you try adding the pluginRepository (see my previous post)? The error comes from not having the prerelease repository for the plugin defined in pom.xml.

Pekka Hyvönen:
Did you try adding the pluginRepository (see my previous post)? The error comes from not having the prerelease repository for the plugin defined in pom.xml.

Yes, I did.

Here is a brand-new fresh project created today using the [Project Base]
(https://vaadin.com/start/latest/project-base) starter pack.

I made 3 changes to the pom.xml file.

(1) I changed the content of the vaadin.version element.

    <!--<vaadin.version>11.0.0</vaadin.version>-->
    <!--change-this-for-alphabetas-->
    <vaadin.version>12.0.0.beta1</vaadin.version>

(2) I added this repository element to the repositories element.

    <!--add-this-for-alphabetas-->
    <repository>
        <id>vaadin-prereleases</id>
        <url>https://maven.vaadin.com/vaadin-prereleases</url>
    </repository>

(3) I added the pluginRepositories element with sub-element pluginRepository to the project element.

<!--add-this-for-alphabetas-->
<pluginRepositories>
    <!-- Repository needed for prerelease versions of Vaadin -->
    <pluginRepository>
        <id>vaadin-prereleases</id>
        <url>https://maven.vaadin.com/vaadin-prereleases</url>
    </pluginRepository>
</pluginRepositories>

After doing the IntelliJ menu item Build > Rebuild Project, and then doing a Maven clean from within IntelliJ, I get an error in the Maven pom.xml file:

Plugin ‘com.vaadin:vaadin-maven-plugin:12.0.0.beta1’ not found

Error occurs for line # 120 seen below:

<version>${vaadin.version}</version>

Here is the entire POM. You can find my changes by searching for the word alphabetas. All 3 changes are in the top-half of the file.

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns = "http://maven.apache.org/POM/4.0.0"
         xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation = "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.basilbourque.example</groupId>
    <artifactId>alphabeta</artifactId>
    <name>AlphaBeta</name>
    <version>1.0-SNAPSHOT</version>
    <packaging>war</packaging>

    <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <failOnMissingWebXml>false</failOnMissingWebXml>

        <!--<vaadin.version>11.0.0</vaadin.version>-->
        <!--change-this-for-alphabetas-->
        <vaadin.version>12.0.0.beta1</vaadin.version>
        <!--  To discover the latest pre-release, see: https://github.com/vaadin/platform/releases  -->
    </properties>

    <repositories>
        <!-- Repository used by many Vaadin add-ons -->
        <repository>
            <id>Vaadin Directory</id>
            <url>http://maven.vaadin.com/vaadin-addons</url>
        </repository>

        <!--add-this-for-alphabetas-->
        <repository>
            <id>vaadin-prereleases</id>
            <url>https://maven.vaadin.com/vaadin-prereleases</url>
        </repository>

    </repositories>

    <!--add-this-for-alphabetas-->
    <pluginRepositories>
        <!-- Repository needed for prerelease versions of Vaadin -->
        <pluginRepository>
            <id>vaadin-prereleases</id>
            <url>https://maven.vaadin.com/vaadin-prereleases</url>
        </pluginRepository>
    </pluginRepositories>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-bom</artifactId>
                <type>pom</type>
                <scope>import</scope>
                <version>${vaadin.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-core</artifactId>
        </dependency>

        <!-- Added to provide logging output as Flow uses -->
        <!-- the unbound SLF4J no-operation (NOP) logger implementation -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!-- Jetty plugin for easy testing without a server -->
            <plugin>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>9.4.11.v20180605</version>
                <configuration>
                    <scanIntervalSeconds>1</scanIntervalSeconds>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <!-- Production mode can be activated with either property or profile -->
            <id>production-mode</id>
            <activation>
                <property>
                    <name>vaadin.productionMode</name>
                </property>
            </activation>
            <properties>
                <vaadin.productionMode>true</vaadin.productionMode>
            </properties>

            <dependencies>
                <dependency>
                    <groupId>com.vaadin</groupId>
                    <artifactId>flow-server-production-mode</artifactId>
                </dependency>
            </dependencies>

            <build>
                <plugins>
                    <plugin>
                        <groupId>com.vaadin</groupId>
                        <artifactId>vaadin-maven-plugin</artifactId>
                        <version>${vaadin.version}</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>copy-production-files</goal>
                                    <goal>package-for-production</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>

To me those steps are working fine - after I’ve edited the pom.xml, IntelliJ asks me to “reimport the maven project”, I click that (can also be done from the project view with right click → maven → reimport). Then I just trigger jetty:run from maven projects view → my-starter-project → plugings → jetty → jetty:run and it “just works”.