【问题标题】:Problem creating Spring framework project in IntelliJ在 IntelliJ 中创建 Spring 框架项目的问题
【发布时间】:2021-01-29 08:08:26
【问题描述】:

我正在尝试根据 Jetbrains 的 official guide 在 IntelliJ 终极版中使用 Spring 初始化程序创建一个 Spring 项目。

所有步骤都很好,包括安装项目的依赖项。

但是每当我尝试运行应用程序时;下面的错误显示已安装在我的依赖项中的“包 org.springframework.boot 不存在”。

我已经浏览了与此问题相关的所有帖子,但没有运气。如果有人能指导我找出问题所在,我将不胜感激。

这也是我下面提供的 pom.xml 内容:

    <?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.3.4.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.example</groupId>
    <artifactId>demo</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>demo</name>
    <description>Demo project for Spring Boot</description>

    <properties>
        <java.version>15</java.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>

【问题讨论】:

标签: java spring spring-boot spring-mvc intellij-idea


【解决方案1】:

在右上角,您有一个刷新按钮,可以再次重新初始化 Pom.xml 文件。一旦所有的 maven 存储库都设置好了,它将允许您启动项目

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-02-12
    • 1970-01-01
    • 2017-07-17
    • 1970-01-01
    • 2021-08-11
    • 2020-11-20
    • 2023-03-24
    相关资源
    最近更新 更多