简体   繁体   English

Maven依赖org.springframework丢失

[英]Maven dependancy org.springframework missing

I am learning Spring from a tutorial where I have been asked to add org.springframework from below. 我正在从一个教程中学习Spring,从那里我被要求从下面添加org.springframework。 But I don't see listed in in here. 但我看不到这里列出。 Using Spring Tool Suite, while the instructor has that in listing. 使用Spring Tool Suite,而讲师将其列出。 What's going wrong? 怎么了

在此处输入图片说明

you can access pom.xml and add 您可以访问pom.xml并添加

 <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>4.1.6.RELEASE</version>
    </dependency>

then after this right click the project->maven->reimport/update dependencies 然后右键单击project->maven->reimport/update dependencies

The other way around to add dependency is : right click the project-> Select Maven -> Add Dependency->select your dependency 添加依赖项的另一种方法是:右键单击项目->选择Maven->添加依赖项->选择依赖项

(assuming you have maven configured correctly, you can refer: http://www.codejava.net/frameworks/spring/creating-a-spring-mvc-project-using-maven-and-eclipse-in-one-minute ) (假设您已经正确配置了Maven,则可以参考: http : //www.codejava.net/frameworks/spring/creating-a-spring-mvc-project-using-maven-and-eclipse-in-一分钟

Initially those repository indexes are not shown in this select dependency section. 最初,这些存储库索引未在此选择依赖项部分中显示。 You need to change your configuration within eclipse so that the m2e plugin pulls down all of the available repositories and indexes.After that you can search them and add them in to your project. 您需要在eclipse中更改配置,以便m2e插件能够提取所有可用的存储库和索引,之后您可以搜索它们并将其添加到项目中。
To do this you need to go to 为此,您需要转到

Windows -> Preferences -> Maven -> Select the check box " Download repository index updates on startup " -> Apply -> Ok Windows->首选项-> Maven->选中复选框“ 在启动时下载存储库索引更新 ”->应用->确定

And Finally restart your eclipse. 最后重新启动蚀。 Hope this will solve your problem. 希望这能解决您的问题。

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

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