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

时间:2017-04-02 12:01:08

标签: spring maven spring-mvc intellij-idea

我不知道,为什么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>

enter image description here

enter image description here

enter image description here

2 个答案:

答案 0 :(得分:7)

转到文件&gt;项目结构

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

然后回到主屏幕。右键点击您项目的名称&gt;添加框架支持。然后你就会看到Spring MVC出现了。

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

答案 1 :(得分:-1)

Intellij社区版仅在ULTIMATE版中不提供Spring框架!!!