在Intellij IDEA中将vaadin添加到Spring引导项目时出错

问题描述 投票:0回答:1

在将Vaadin添加到我的Spring启动项目中时出现这些错误(我正在使用Intellij IDEA):

Cannot resolve plugin com.vaadin:vaadin-maven-plugin:${vaadin.version}
Cannot resolve com.vaadin:vaadin-spring-boot-starter:${vaadin.version}

这是pom.xml中的相关部分,与vaadin网站上建议的相同:

        <<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-bom</artifactId>
            <!-- declare the latest Vaadin version
                 as a property or directly here -->
            <version>${vaadin.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

<dependencies>
    <dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>
            vaadin-spring-boot-starter
        </artifactId>
        <version>${vaadin.version}</version>
    </dependency>
</dependencies>
<build>
    <plugins>
        <!-- The Spring Boot Maven plugin for easy
             execution from CLI and packaging -->
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>
                spring-boot-maven-plugin
            </artifactId>
        </plugin>

        <!--
            Takes care of synchronizing java
            dependencies and imports in package.json and
            main.js files. It also creates
            webpack.config.js if does not exist yet.
        -->
        <plugin>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-maven-plugin</artifactId>
            <version>${vaadin.version}</version>
            <executions>
                <execution>
                    <goals>
                        <goal>prepare-frontend</goal>
                        <goal>build-frontend</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

我该如何解决?我需要配置其他内容吗?

谢谢

spring-boot maven dependencies vaadin pom.xml
1个回答
1
投票

错误表明您在pom.xml的<vaadin.version>VersionYourWantToUse</vaadin.version>代码段中缺少property <properties>。例如,Vaadin弹簧靴启动器的pom.xml file中有此部分:

pom.xml

并且作为摘要中的注释状态,您可以直接用值替换 <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> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <vaadin.version>14.1.25</vaadin.version> </properties> 的引用(例如${vaadin.version}),或使用<version>14.1.25</version>,如上所示。

© www.soinside.com 2019 - 2024. All rights reserved.