在新获取git中项目时出现的问题汇总

新下拉git项目,今天遇到的问题,因为刚配置实用jdk和idea,所以有可能在打开springboot项目时查看mysql数据库驱动显示为红色.

之后看到pom文件也没有错,最后发现才是在项目中还没有setup JDK,之后bug消除.

 

在下拉git项目时,需要更改当前文件为源目录,如下图:

还需要右键下pom.xml  选择 Add as Maven Project

之后需要重新导入下依赖.

如果依赖出错,则可能是maven版本,仓库地址不同引发的.

IDEA中打开setting配置现有或者共同的maven版本

仓库调整在maven目录中的conf文件夹下的settings.xml

需要调整镜像地址 如下 (例子里是阿里云的中央仓库)

  <mirrors>
    <!-- mirror
     | Specifies a repository mirror site to use instead of a given repository. The repository that
     | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
     | for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
     |
    <mirror>
      <id>mirrorId</id>
      <mirrorOf>repositoryId</mirrorOf>
      <name>Human Readable Name for this Mirror.</name>
      <url>http://my.repository.com/repo/path</url>
    </mirror>
     -->

    <mirror>
      <id>alimaven</id>
      <name>aliyun maven</name>
      <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
      <mirrorOf>central</mirrorOf>        
    </mirror>




  </mirrors>

之后IDEA中提示重新导入maven依赖基本就告别这个bug了.

 

ps: 有的依赖是必须依赖某些其它安装的,例如 lombok

 

posted @ 2019-04-01 13:09  ukyo--BlackJesus  阅读(598)  评论(0编辑  收藏  举报