Intellij Idea和Spring and Maven:添加框架支持

Sam*_*oos 5 spring spring-mvc intellij-idea maven

我不知道,为什么maven不将Spring添加到Intellij"添加框架支持"窗口.我需要这种支持让Intellij生成一些像dispatcher-servlet.xml这样的文件.我不知道哪个负责将Spring添加到这个窗口,maven或Intellij?我添加了spring依赖项,所有插件都已安装.我有Ultimate Intellij 2017.1版本.

的pom.xml

<groupId>com.test</groupId>
    <artifactId>test</artifactId>
    <version>1.0-SNAPSHOT</version>

    <dependencies>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>4.3.7.RELEASE</version>
        </dependency>
    </dependencies>
</project>
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

在此输入图像描述

在此输入图像描述

Tra*_* Le 9

转到文件>项目结构

你会看到Spring(你的项目的名字).在这种情况下,我的项目名称是HelloWorldDemo.然后右键单击Spring(HelloWorldDemo)并选择删除

然后回到主屏幕.右键单击项目名称>添加框架支持.然后你会看到Spring MVC出现.

我希望这有帮助.这是我在StackOverFlow的第一个答案.如果我在发布答案时犯了一些错误,那就很抱歉.