关于学习SpringBoot遇到的问题之一

在学习SpringBoot时遇到依赖导入问题,jQuery库无法正常导入导致依赖颜色变红。进一步发现,项目的setting.xml文件未指定Maven本地仓库路径,通过在设置中添加路径并配置阿里镜像,成功解决了这个问题。
摘要由CSDN通过智能技术生成

关于学习SpringBoot遇到的问题之一

依赖颜色变红

今天遇到一个问题:在导入jQuery依赖的时候导不进去,依赖老是变红,最后搞着搞着,变成project标签变红,
报的这个错误:
Failure to transfer org.springframework.boot:spring-boot-starter-parent:pom:2.0.1.RELEASE from http://maven.aliyun.com/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of alimaven has elapsed or updates are forced. Original error: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.0.1.RELEASE from/to alimaven (http://maven.aliyun.com/nexus/content/groups/public/): maven.aliyun.com

发现问题:在新项目中生成setting.xml的时候,打开只显示了以下内容:

                          <?xml version="1.0" encoding="UTF-8"?>
<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">
<settings>,

这里面没有在IDEA面指定的路径(file–>setting–>搜索“maven“–>local repositoty),于是我在setting.xml里面添加他的路径,并且又链接阿里的镜像,最后我的xml文件显示如下:

  <?xml version="1.0" encoding="UTF-8"?>
<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">
<!-- localRepository
   | The path to the local repository maven will use to store artifacts.
   |
   | Default: ${
  user.home}/.m2/repository
  <localRepository>/path/to/local/repo</localRepository>
  -->
  <localRepository>C:\Users\lenvoo\.m2\repository</localRepository>


  <!-- interactiveMode
   | This will determine whether maven prompts you when it needs input. If set to false,
   | maven will use a sensible default value, perhaps based on some other setting, for
   | the parameter in question.
   |
   | Default: true
  <interactiveMode>true</interactiveMode>
  -->
  <!-- offline
   | Determines whether maven should attempt to connect to the network when executing a build.
   | This will have an effect on artifact downloads, artifact deployment, and others.
   |
   | Default: false
  <offline>false</offline>
  -->
  <!-- pluginGroups
   | This is a list of additional group identifiers that will be searched when resolving plugins by their prefix, i.e.
   | when invoking a command line like "mvn prefix:goal". Maven will automatically add the group identifiers
   | "org.apache.maven.plugins" and "org.codehaus.mojo" if these are not already contained in the list.
   |-->
  <pluginGroups
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值