为什么我的Spring导入语句不起作用?

时间:2019-05-01 13:15:53

标签: spring intellij-14

enter image description here

我的任何导入语句均无用。我正在IntelliJ中制作项目

我已经将其包含在pom.xml中
enter image description here

1 个答案:

答案 0 :(得分:1)

因为要在pom.xml中导入弹簧测试工件  然后尝试导入spring包类

<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>

尝试添加

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.5.RELEASE</version>
    </parent>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
    </dependencies>
相关问题