Vaadin 8 alpha/beta prerelease fail with “Non-resolvable import POM: Failure to find” errors

谁说胖子不能爱 提交于 2019-12-25 02:18:59

问题


I have not been able to try the alpha and beta versions of Vaadin 8.

➥ What exactly do I need to do to change a working Vaadin 8.5.2 project to use Vaadin 8.6.0beta1?

Scenario

I am using IntelliJ 2018.3, configured to use external Maven 3.5.4.

I followed the instructions seen at: https://vaadin.com/framework/releases/8.6.0.beta1

Actually, my POM already had the pair of <id>vaadin-prereleases</id> entries as shown on that page:

<repositories>
         <!-- ... -->

         <repository>
             <id>vaadin-prereleases</id>
             <name>Vaadin Pre-releases</name>
             <url>https://maven.vaadin.com/vaadin-prereleases</url>
         </repository>

</repositories>

<pluginRepositories>
         <!-- ... -->

         <pluginRepository>
             <id>vaadin-prereleases</id>
             <name>Vaadin Pre-releases</name>
             <url>https://maven.vaadin.com/vaadin-prereleases</url>
         </pluginRepository>

</pluginRepositories>

Problem

When I change:

<vaadin.version>8.5.2</vaadin.version>
<vaadin.plugin.version>8.5.2</vaadin.plugin.version>

to:

<vaadin.version>8.6.0beta1</vaadin.version>
<vaadin.plugin.version>8.6.0beta1</vaadin.plugin.version>

…I get the following errors when running a Maven clean, basically about Non-resolvable import POM: Failure to find com.vaadin:vaadin-bom:pom:8.6.0beta1

Console:

[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:8.6.0beta1 in http://maven.vaadin.com/vaadin-addons was cached in the local repository, resolution will not be reattempted until the update interval of vaadin-addons has elapsed or updates are forced @ line 41, column 25
[ERROR] 'dependencies.dependency.version' for com.vaadin:vaadin-server:jar is missing. @ line 58, column 21
[ERROR] 'dependencies.dependency.version' for com.vaadin:vaadin-push:jar is missing. @ line 62, column 21
[ERROR] 'dependencies.dependency.version' for com.vaadin:vaadin-client-compiled:jar is missing. @ line 66, column 21
[ERROR] 'dependencies.dependency.version' for com.vaadin:vaadin-themes:jar is missing. @ line 70, column 21
 @ 
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project com.basilbourque.example:grid-refresh:1.0-SNAPSHOT (/Users/basilbourque/IdeaProjects/GridRefresh/pom.xml) has 5 errors
[ERROR]     Non-resolvable import POM: Failure to find com.vaadin:vaadin-bom:pom:8.6.0beta1 in http://maven.vaadin.com/vaadin-addons was cached in the local repository, resolution will not be reattempted until the update interval of vaadin-addons has elapsed or updates are forced @ line 41, column 25 -> [Help 2]
[ERROR]     'dependencies.dependency.version' for com.vaadin:vaadin-server:jar is missing. @ line 58, column 21
[ERROR]     'dependencies.dependency.version' for com.vaadin:vaadin-push:jar is missing. @ line 62, column 21
[ERROR]     'dependencies.dependency.version' for com.vaadin:vaadin-client-compiled:jar is missing. @ line 66, column 21
[ERROR]     'dependencies.dependency.version' for com.vaadin:vaadin-themes:jar is missing. @ line 70, 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

I do not have these problems when changing those two lines to an official release such as 8.5.0 or 8.5.1. The problem is only with the alpha and beta prereleases.

Here is one example POM 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>grid-refresh</artifactId>
    <packaging>war</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>grid-refresh</name>

    <prerequisites>
        <maven>3</maven>
    </prerequisites>

    <properties>
        <!-- Changing this… -->
        <!--<vaadin.version>8.5.2</vaadin.version>-->
        <!--<vaadin.plugin.version>8.5.2</vaadin.plugin.version>-->
        <!-- …to this… -->
        <vaadin.version>8.6.0beta1</vaadin.version>
        <vaadin.plugin.version>8.6.0beta1</vaadin.plugin.version>
        <!-- …fails with an error message:  Non-resolvable import POM: Failure to find com.vaadin:vaadin-bom:pom:8.6.0beta1 in http://maven.vaadin.com/vaadin-addons was cached in the local repository, resolution will not be reattempted until the update interval of vaadin-addons has elapsed or updates are forced @ line 41, column 25 -->
        <jetty.plugin.version>9.4.12.v20180830</jetty.plugin.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>10</maven.compiler.source>
        <maven.compiler.target>10</maven.compiler.target>
        <!-- If there are no local customizations, this can also be "fetch" or "cdn" -->
        <vaadin.widgetset.mode>local</vaadin.widgetset.mode>
    </properties>

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

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

    <dependencies>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-server</artifactId>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-push</artifactId>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-client-compiled</artifactId>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-themes</artifactId>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>3.2.2</version>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                    <!-- Exclude an unnecessary file generated by the GWT compiler. -->
                    <packagingExcludes>WEB-INF/classes/VAADIN/widgetsets/WEB-INF/**</packagingExcludes>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-maven-plugin</artifactId>
                <version>${vaadin.plugin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>update-theme</goal>
                            <goal>update-widgetset</goal>
                            <goal>compile</goal>
                            <!-- Comment out compile-theme goal to use on-the-fly theme compilation -->
                            <goal>compile-theme</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <version>3.1.0</version>
                <!-- Clean up also any pre-compiled themes -->
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>src/main/webapp/VAADIN/themes</directory>
                            <includes>
                                <include>**/styles.css</include>
                                <include>**/styles.scss.cache</include>
                            </includes>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>

            <!-- The Jetty plugin allows us to easily test the development build by
                running jetty:run on the command line. -->
            <plugin>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>${jetty.plugin.version}</version>
                <configuration>
                    <scanIntervalSeconds>2</scanIntervalSeconds>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <!-- Vaadin pre-release repositories -->
            <id>vaadin-prerelease</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>

            <repositories>
                <repository>
                    <id>vaadin-prereleases</id>
                    <name>Vaadin Pre-releases</name>
                    <url>http://maven.vaadin.com/vaadin-prereleases</url>
                </repository>
                <repository>
                    <id>vaadin-snapshots</id>
                    <url>https://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
                    <releases>
                        <enabled>false</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <id>vaadin-prereleases</id>
                    <name>Vaadin Pre-releases</name>
                    <url>http://maven.vaadin.com/vaadin-prereleases</url>
                </pluginRepository>
                <pluginRepository>
                    <id>vaadin-snapshots</id>
                    <url>https://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
                    <releases>
                        <enabled>false</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </pluginRepository>
            </pluginRepositories>
        </profile>
    </profiles>

</project>

I tried deleting the .m2 > repository folder in my home folder. Did not help.


回答1:


I see two problems:

  1. There is a . missing in the version string. It should be 8.6.0.beta1 instead of 8.6.0beta1.
  2. The prerelease repository is only configured for the vaadin-prerelease profile, which isn't enabled by default. You need to change your pom.xml to always enable the profile or manually enable it when building the application (using e.g. -Pvaadin-prerelease from the command line). The profile is not enabled by default for performance reasons.

See this screenshot from IntelliJ 2018, showing:

  • The vaadin-prerelease profile enabled by a checkbox.
  • Valid value in vaadin-version element of POM file.



来源:https://stackoverflow.com/questions/52583609/vaadin-8-alpha-beta-prerelease-fail-with-non-resolvable-import-pom-failure-to

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!