Vaadin 7/8 + MPR production mode build gives errors

Hello,
As per https://vaadin.com/docs/v13/mpr/configuration/production-mode.html, I am having problems building production mode for my MPR projects. Even demo ones give problems. Any ideas?
If I use <artifactId>flow-maven-plugin</artifactId>, as per this link, I get the following:

PS D:\<userid>\Documents\Vaadin10-MigrationWithMPR\Solutions\solution-dashboard> mvn clean package -Pproduction
[INFO]
 Scanning for projects...
[INFO]

[INFO]
 ------------< com.vaadin.training.mpr:dashboard-solutions >-------------
[INFO]
 Building dashboard-solutions 1.0.0-SNAPSHOT
[INFO]
 --------------------------------[ war ]
---------------------------------
Downloading from central: https://repo.maven.apache.org/maven2/com/vaadin/flow-maven-plugin/13.0.3/flow-maven-plugin-13.0.3.pom
[WARNING]
 The POM for com.vaadin:flow-maven-plugin:jar:13.0.3 is missing, no dependency information available
Downloading from central: https://repo.maven.apache.org/maven2/com/vaadin/flow-maven-plugin/13.0.3/flow-maven-plugin-13.0.3.jar
[INFO]
 ------------------------------------------------------------------------
[INFO]
 BUILD FAILURE
[INFO]
 ------------------------------------------------------------------------
[INFO]
 Total time:  1.332 s
[INFO]
 Finished at: 2019-06-21T14:04:40-04:00
[INFO]
 ------------------------------------------------------------------------
[ERROR]
 Plugin com.vaadin:flow-maven-plugin:13.0.3 or one of its dependencies could not be resolved: Could not find artifact com.vaadin:flow-maven-plugin:jar:13.0.3 in central (https://repo.maven.apache.org/maven2) -> [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/PluginResolutionException

Granted, maybe I misunderstood what they meant by <version>${flow.version}</version>. I thought they really mean just 13.0.8 ( for instance ), but maybe they meant they meant something like 2.0.0. so when I changed the version to be 2.0.0, I get the following:

PS D:\tonybaldarelli\Documents\Vaadin10-MigrationWithMPR\Solutions\solution-dashboard> mvn package -Pproduction
[INFO]
 Scanning for projects...
[INFO]

[INFO]
 ------------< com.vaadin.training.mpr:dashboard-solutions >-------------
[INFO]
 Building dashboard-solutions 1.0.0-SNAPSHOT
[INFO]
 --------------------------------[ war ]
---------------------------------
[INFO]

[INFO]
 --- vaadin-maven-plugin:7.7.15:update-theme (default) @ dashboard-solutions ---
...
on-dashboard\target\frontend\bower_components\vaadin-upload\theme\lumo\vaadin-upload-file.html'
[INFO]
 ------------------------------------------------------------------------
[INFO]
 BUILD FAILURE
[INFO]
 ------------------------------------------------------------------------
[INFO]
 Total time:  9.910 s
[INFO]
 Finished at: 2019-06-21T14:10:38-04:00
[INFO]
 ------------------------------------------------------------------------
[ERROR]
 Failed to execute goal com.vaadin:flow-maven-plugin:2.0.0:package-for-production (default) on project dashboard-solutions: Execution default of goal com.vaadin:flow-maven-plugin:2.0.0:package-for-production failed: Failed to load class 'com.vaadin.flow.component.WebComponentExporter' in custom classloader -> [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/PluginExecutionException

So it got farther, but still failed.

If I use `<artifactId>vaadin-maven-plugin</artifactId>`, as specified in https://vaadin.com/docs/v13/flow/production/tutorial-production-mode-basic.html, I get something like the following:
PS D:\tonybaldarelli\Documents\Vaadin10-MigrationWithMPR\Solutions\solution-dashboard> mvn clean package -Pproduction
[INFO]
 Scanning for projects...
[INFO]

[INFO]
 ------------< com.vaadin.training.mpr:dashboard-solutions >-------------
[INFO]
 Building dashboard-solutions 1.0.0-SNAPSHOT
[INFO]
 --------------------------------[ war ]
---------------------------------
[INFO]
 ------------------------------------------------------------------------
[INFO]
 BUILD FAILURE
[INFO]
 ------------------------------------------------------------------------
[INFO]
 Total time:  0.212 s
[INFO]
 Finished at: 2019-06-21T14:00:45-04:00
[INFO]
 ------------------------------------------------------------------------
[ERROR]
 Could not find goal 'resources' in plugin com.vaadin:vaadin-maven-plugin:13.0.3 among available goals copy-production-files, package-for-production -> [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/MojoNotFoundException

Based on your other posting, you apparently figured out that you need to apply the Flow version not the Vaadin version for the flow-maven-plugin.

I guess I was not clear. I am still getting an error, even with flow version 2.0.0. Here it is, a second attempt. First of all, the part of the POM we are discussing:

		<profile>
    		<id>production</id>

    		<dependencies>
        		<dependency>
            		<groupId>com.vaadin</groupId>
            		<artifactId>flow-server-production-mode</artifactId>
            		<!-- <version>${vaadin.version}</version> -->
            		<version>2.0.0</version>
        		</dependency>
    		</dependencies>

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

            		<plugin>
                		<groupId>org.eclipse.jetty</groupId>
                		<artifactId>jetty-maven-plugin</artifactId>
                		<version>9.4.14.v20181114</version>
                		<configuration>
                    		<webAppConfig>
                        		<resourceBases>
                            		<resourceBase>${project.build.directory}/${project.build.finalName}/</resourceBase>
                            		<resourceBase>${basedir}/src/main/webapp/</resourceBase>
                        		</resourceBases>
                    		</webAppConfig>
                		</configuration>
            		</plugin>
        		</plugins>
    		</build>
		</profile>
PS D:\<userid>\Documents\Vaadin10-MigrationWithMPR\Solutions\solution-dashboard> mvn clean package -Pproduction
[INFO]
 Scanning for projects...
[INFO]

[INFO]
 ------------< com.vaadin.training.mpr:dashboard-solutions >-------------
[INFO]
 Building dashboard-solutions 1.0.0-SNAPSHOT
[INFO]
 --------------------------------[ war ]
---------------------------------
[INFO]

[INFO]
 --- maven-clean-plugin:2.5:clean (default-clean) @ dashboard-solutions ---
[INFO]
 Deleting D:\tonybaldarelli\Documents\Vaadin10-MigrationWithMPR\Solutions\solution-dashboard\target
[INFO]
 Deleting D:\tonybaldarelli\Documents\Vaadin10-MigrationWithMPR\Solutions\solution-dashboard\src\main\webapp\VAADIN\widgetsets (includes = [], excludes = []
)
[INFO]

[INFO]
 --- vaadin-maven-plugin:7.7.15:update-theme (default) @ dashboard-solutions ---
[INFO]
 Updating theme VAADIN\themes\dashboard
[INFO]
 Widgetsets found from classpath:
[INFO]
  com.vaadin.mpr.MprWidgetSet in jar:file:C:/Users/tonybaldarelli/.m2/repository/com/vaadin/mpr-v7/1.2.0/mpr-v7-1.2.0.jar!/
[INFO]
  com.vaadin.addon.timeline.gwt.TimelineWidgetSet in jar:file:C:/Users/tonybaldarelli/.m2/repository/com/vaadin/addon/vaadin-charts/2.0.0/vaadin-charts-2.0.0.jar!/
[INFO]
  com.vaadin.DefaultWidgetSet in jar:file:C:/Users/tonybaldarelli/.m2/repository/com/vaadin/vaadin-client/7.7.15/vaadin-client-7.7.15.jar!/
[INFO]
  com.vaadin.addon.charts.Widgetset in jar:file:C:/Users/tonybaldarelli/.m2/repository/com/vaadin/addon/vaadin-charts/2.0.0/vaadin-charts-2.0.0.jar!/
[INFO]
 Addon styles found from classpath:
[INFO]

[INFO]
 Search took 20ms
[INFO]
 Theme "VAADIN\themes\dashboard" updated
...
[INFO]
 Linking into D:\tonybaldarelli\Documents\Vaadin10-MigrationWithMPR\Solutions\solution-dashboard\src\main\webapp\VAADIN\widgetsets\com.vaadin.demo.dashboard.DashboardWidgetSet; Writing extras to D:\tonybaldarelli\Documents\Vaadin10-MigrationWithMPR\Solutions\solution-dashboard\target\extra\com.vaadin.demo.dashboard.DashboardWidgetSet
[INFO]
    Link succeeded
[INFO]
    Linking succeeded -- 1.940s
[INFO]

[INFO]
 --- flow-maven-plugin:2.0.0:package-for-production (default) @ dashboard-solutions ---
[WARNING]
 The translated URL 'frontend://bower_components/vaadin-upload/theme/lumo/vaadin-upload-file.html' has no corresponding file on the filesystem, the file is addressed by path='D:\tonybaldarelli\Documents\Vaadin10-MigrationWithMPR\Solutions\solution-dashboard\target\frontend\bower_components\vaadin-upload\theme\lumo\vaadin-upload-file.html'
[INFO]
 ------------------------------------------------------------------------
[INFO]
 BUILD FAILURE
[INFO]
 ------------------------------------------------------------------------
[INFO]
 Total time:  01:13 min
[INFO]
 Finished at: 2019-06-22T19:52:25-04:00
[INFO]
 ------------------------------------------------------------------------
[ERROR]
 Failed to execute goal com.vaadin:flow-maven-plugin:2.0.0:package-for-production (default) on project dashboard-solutions: Execution default of goal com.vaadin:flow-maven-plugin:2.0.0:package-for-production failed: Failed to load class 'com.vaadin.flow.component.WebComponentExporter' in custom classloader -> [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/PluginExecutionException

Note that it is failing on the load of WebComponentExporter. I don’t get this error with pure flow projects, only with MPR projects.

The key was using flow.version = 1.4.5 instead of 2.0.0 since I am using vaadin.version = 13.0.8. Is this documented anyplace?

The key was using flow.version = 1.4.5 instead of 2.0.0

Yes, 2.0.0 is part of Vaadin 14, so that was likely cause of trouble. And with Vaadin 14 it will required also different version of MPR to be used.

I can confirm, that Vaadin 13.0.8 + flow 1.4.6 gives no error.
@TatuLund Is this flow version to vaadin version documented somewhere?