解决eclipse maven插件 add dependencies搜索不到spring-webmvc的问题

今天在Eclipse配置Spring框架时发现不能在Eclipse的pom.xml->Dependencies->Add...加载spring-webmvc的框架

在此处输入spring-webmvc没有反应,只有本地的包能搜索到。

解决方案:

1.Windows->Preferences

.

在User Settings标题所示的目录下创建setting.xml,里面的内容为:

<?xml version="1.0"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
    <mirrors>
        <mirror>
            <id>Nexus</id>
            <name>Nexus Public Mirror</name>
            <url>http://121.42.166.202:8081/nexus/content/groups/public</url>
            <mirrorOf>central</mirrorOf>
        </mirror>
    </mirrors>

    <profiles>
        <profile>
            <id>dev</id>
            <repositories>
                <repository>
                    <id>Nexus</id>
                    <url>http://121.42.166.202:8081/nexus/content/groups/public</url>
                    <releases>
                        <enabled>true</enabled>
                        <updatePolicy>always</updatePolicy>
                        <checksumPolicy>warn</checksumPolicy>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                        <updatePolicy>never</updatePolicy>
                        <checksumPolicy>fail</checksumPolicy>
                    </snapshots>
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <id>Nexus</id>
                    <url>http://121.42.166.202:8081/nexus/content/groups/public</url>
                    <releases>
                        <enabled>true</enabled>
                        <checksumPolicy>warn</checksumPolicy>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                        <checksumPolicy>fail</checksumPolicy>
                    </snapshots>
                </pluginRepository>
            </pluginRepositories>
            <!-- <properties> <environment.type>prod</environment.type> </properties> -->
        </profile>
    </profiles>
    <activeProfiles>
        <activeProfile>dev</activeProfile>
    </activeProfiles>
</settings>

2.创建完毕后,去勾选

这一个条目

具体位置如下:

3.Apply and Close后,按alt+f5重构项目

把重构的项目勾上就行,然后就需要等待一下,时间后有些长,我大概花了5分钟左右,才完成。

下方有两个参考的帖子:

https://blog.csdn.net/my13413527259/article/details/78367180

http://www.cnblogs.com/ClassNotFoundException/p/6262445.html?utm_source=itdadao&utm_medium=referral

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值