将基于Vaadin 11的Maven驱动项目更改为Vaadin 12 alpha版本? 问题

将基于Vaadin 11的Maven驱动项目更改为Vaadin 12 alpha版本? 问题,maven,intellij-idea,vaadin,project,vaadin-flow,Maven,Intellij Idea,Vaadin,Project,Vaadin Flow,我在2018年3月11日有一个工作项目,使用starter pack创建 ➥ 如何从Vaadin 11.0.0切换到Vaadin 12.0.0.4 我这里的问题和这个类似。在该页面上,在IntelliJ的Maven侧栏的Profiles列表中启用vaadin prerelease复选框。但是在Vaadin 11项目中,唯一一个这样的复选框被标记为production mode 失败的解决方案 在项目的Maven POM文件中,POM.xml,我尝试切换: 11.0.0 …致: 12.0.0.4

我在2018年3月11日有一个工作项目,使用starter pack创建

➥ 如何从Vaadin 11.0.0切换到Vaadin 12.0.0.4

我这里的问题和这个类似。在该页面上,在IntelliJ的Maven侧栏的Profiles列表中启用
vaadin prerelease
复选框。但是在Vaadin 11项目中,唯一一个这样的复选框被标记为
production mode

失败的解决方案 在项目的Maven POM文件中,
POM.xml
,我尝试切换:

11.0.0
…致:

12.0.0.4
…已从中获取版本号字符串

在使用此版本号执行Maven
clean
时,会出现以下错误:

[INFO]正在扫描项目。。。
[错误][错误]处理POM时遇到一些问题:
[错误]不可解析的导入POM:未能在中找到com.vaadin:vaadin bom:POM:12.0.0.4http://maven.vaadin.com/vaadin-addons 已缓存在本地存储库中,在Vaadin目录的更新间隔已过或在第28行第25列强制更新之前,不会重新尝试解析
[错误]:缺少com.vaadin:vaadin core:jar的“dependencies.dependency.version”。@第39行第21列
[错误].slf4j:slf4j simple:jar的“dependencies.dependency.version”丢失。@第46行第21列
@ 
[错误]生成无法读取1个项目->[帮助1]
[错误]
[错误]项目com.basilbourque.acme:acme:1.0-SNAPSHOT(/Users/basilbourque/IdeaProjects/acme/pom.xml)有3个错误
[错误]不可解析的导入POM:未能在中找到com.vaadin:vaadin bom:POM:12.0.0.4http://maven.vaadin.com/vaadin-addons 已缓存在本地存储库中,将不会重新尝试解析,直到Vaadin目录的更新间隔已过,或者在第28行第25列强制更新->[帮助2]
[错误]:缺少com.vaadin:vaadin core:jar的“dependencies.dependency.version”。@第39行第21列
[错误].slf4j:slf4j simple:jar的“dependencies.dependency.version”丢失。@第46行第21列
[错误]
[错误]要查看错误的完整堆栈跟踪,请使用-e开关重新运行Maven。
[错误]使用-X开关重新运行Maven以启用完整调试日志记录。
[错误]
[错误]有关错误和可能的解决方案的更多信息,请阅读以下文章:
[错误][帮助1]http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[错误][帮助2]http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
简单的方法 瓦丁有限公司现在让这变得更容易。他们在页面上添加了一个标签,列出了预配置为使用最新预发布版本的POM的启动包

手动方式 我不知道下面的解决方案是否合适,但似乎有效。不幸的是,Vaadin网站上没有记录解决方案,因此

配置预发布Maven存储库 Project Base starter pack构建的文件似乎缺少查找Vaadin的alpha/beta预发布版本所需的配置设置

从2018年11月15日起,对于Vaadin 12.0.0.beta2,采用一个工作项目,例如从启动包的Vaadin pago上的“项目基础”创建的项目,并进行以下更改。这在今天起作用,但我已经有了。我怀疑问题在于一些Maven或Vaadin存储库没有正确更新,并且缺少一些关键文件。无论如何,它在今天起作用了

首先,在GitHub上的vaadin/platform页面上查找最新的alpha或beta版本号。今天这是
12.0.0.beta2

(一)

刷新Maven的本地缓存

在IntelliJ 2018中,选择
首选项
/
设置
构建、执行、部署
构建工具
存储库
更新
(按钮)

(二)

在项目的POM文件中,更改以下内容:

<vaadin.version>11.0.2</vaadin.version>
(四)

存储库
元素下方添加以下内容:

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

是的,这是正确的答案。Alpha和Beta被发布到prereleases maven repository,而不是maven central。@Jensjanson您知道为什么版本8中maven“Profiles”窗格中的
vaadin prerelease
复选框不在Flow中吗?我不确定。我更多地从命令行使用maven,所以我不熟悉IntelliJ中的面板。额外的存储库很可能在pom.xml中以不同的方式配置。或者,Vaadin 8 Mavenplugin配置了一个额外的配置文件,这在Vaadin平台中不存在。有关Vaadin 14,请参阅:。和我的差不多。
<pluginRepositories>
    <!-- Repository needed for prerelease versions of Vaadin -->
    <pluginRepository>
        <id>vaadin-prereleases</id>
        <url>https://maven.vaadin.com/vaadin-prereleases</url>
    </pluginRepository>
</pluginRepositories>
<?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.acme</groupId>
    <artifactId>acme</artifactId>
    <name>Acme</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.2</vaadin.version>-->
        <!--Change above line to line below for alphas-betas-->
        <vaadin.version>12.0.0.beta2</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>

        <!--Add this for alphas-betas-->
        <repository>
            <id>vaadin-prereleases</id>
            <url>https://maven.vaadin.com/vaadin-prereleases</url>
        </repository>

    </repositories>

    <!--Add this for alphas-betas-->
    <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>