当前位置: 首页 > 知识库问答 >
问题:

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

公冶翰池
2023-03-14

我在Intellij2018.3中有一个用于Vaadin11的工作项目,使用project Base Starter-Pack创建。

如何从Vaadin 11.0.0切换到Vaadin 12.0.0.alpha4?

我在这里的问题类似于这个问题,Vaadin 8 alpha/beta预启动失败与“不可解决的导入POM:失败找不到”错误。该页面上的解决方案是在Intellij的Maven侧栏中的Profiles列表中启用vaadin-prerelease复选框。但是对于Vaadin11项目,找到的唯一这样的复选框标记为production-mode

<vaadin.version>11.0.0</vaadin.version>
<vaadin.version>12.0.0.alpha4</vaadin.version>

在执行具有此版本号的Mavenclean时,我会遇到以下错误:

[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.0.alpha4 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 28, column 25
[ERROR] 'dependencies.dependency.version' for com.vaadin:vaadin-core:jar is missing. @ line 39, column 21
[ERROR] 'dependencies.dependency.version' for org.slf4j:slf4j-simple:jar is missing. @ line 46, column 21
 @ 
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project com.basilbourque.acme:acme:1.0-SNAPSHOT (/Users/basilbourque/IdeaProjects/Acme/pom.xml) has 3 errors
[ERROR]     Non-resolvable import POM: Failure to find com.vaadin:vaadin-bom:pom:12.0.0.alpha4 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 28, column 25 -> [Help 2]
[ERROR]     'dependencies.dependency.version' for com.vaadin:vaadin-core:jar is missing. @ line 39, column 21
[ERROR]     'dependencies.dependency.version' for org.slf4j:slf4j-simple:jar is missing. @ line 46, column 21
[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

共有1个答案

林鸿飞
2023-03-14

Vaadin Ltd现在让这变得更容易。他们在页面上添加了一个选项卡,列出了预配置为使用最新预发行版的POM的启动包。

https://vaadin.com/start/pre-release

我不知道下面的解决方案是否合适,但它似乎奏效了。不幸的是,Vaadin站点上没有记录解决方案,所以我提出了一个请求。

为Maven刷新本地缓存。

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

(2)

<vaadin.version>11.0.2</vaadin.version>
 <vaadin.version>12.0.0.beta2</vaadin.version>

repositories元素中,添加以下内容:

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

(4)

repositories元素下面添加以下内容:

<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>

 类似资料:
  • 看起来好像什么都没有出问题,但我一定是错过了什么,因为我总是收到这个错误。 下面是my.settings/org.eclipse.wst.common.project.facet.core.xml的内容 在我试图压制这个看似不相关的错误消息时,任何帮助都非常感谢。 编辑:添加了pom.xml内容

  • 嗨,我的chrome版本是76。。但我的量角器web驱动程序管理器使用chrome版本78。我已经将配置文件中的chrome版本更改为76,如下所示 {“webdriverVersions”:{“selenium”:“2.53.1”,“chromedriver”:“2.27”,“maxChromedriver”:“76”,“geckodriver”:“v0.13.0”,“iedriver”:“2.

  • 问题内容: 我需要编写一个仅与Java 1.5兼容的项目。我已经安装了Java 1.6。是否存在某种形式的向后兼容性,以使Eclipse用1.5进行编译? 我必须安装Java 1.5才能在此处显示它吗?也许还有另一种方法? 问题答案: 单击添加库按钮。它使你的屏幕指向Java位置。 选择“ 目录 ”,在JRE主页旁边的按钮,然后指向已安装的文件夹位置。 即使只需要1.5个编译器项目,也可以通过在E

  • 我需要编写一个只与Java1.5兼容的项目。我已经安装了Java1.6。是否有某种形式的向后兼容性来让Eclipse用1.5编译? 我必须安装Java1.5才能在这里显示它吗?或者也许还有别的办法?

  • 首先,我使用的是Ubuntu12.04,Eclipse Juno和maven 3.0.4(m2eclipse),我必须在一个从SVN存储库中获得的遗留项目中工作。

  • 我将计划将我基于Spring的java项目转换成maven项目,所以在这个对话中,我应该遵循什么样的项目结构和配置