繁体   English   中英

尽管使用了依赖项,但无法获得 springframework 注释的自动建议

[英]Unable to get the auto-suggestion for annotations for springframework inspite of using the dependency

我已经从 spring 初始化程序创建了一个 spring 项目并将其导入 IntelliJ,在创建时包含了 Web 依赖项,但我没有得到注释的自动建议,尽管 pom.xml 具有它的依赖项。

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>

我尝试重新启动并加载 maven,但仍然无法正常工作。 这里需要一些帮助。

你能告诉我们你的整个 POM.XML 文件吗? 你确定你已经实现了 Spring Web 依赖吗? 下面我将向您展示 Spring Web 依赖项的 XML 代码。 以上是Spring项目中自动提供的测试。

此外,请考虑重新加载您的 Maven 项目以应用依赖项。

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

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
        <scope>runtime</scope>
        <optional>true</optional>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.tomcat.embed</groupId>
        <artifactId>tomcat-embed-core</artifactId>
    </dependency>
</dependencies>
<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM