IDEA配置全局默认Maven(图文讲解)

IDEA全局Maven

步骤一:
File > Other Settings > Settings for New Projects…
在这里插入图片描述

步骤二:
Build,Execution,Deployment > Build Tools > Maven
在这里插入图片描述

步骤三:
配置settings.xml
把settings.xml文件直接往IDEA里拉,把多余的注释和节点删掉在这里插入图片描述
代码:

<?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">

<!--配置阿里云镜像服务器。在mirrors标签里添加以下一段即可。-->
  <mirrors>
    <mirror>
      <id>alimaven</id>
      <name>aliyun maven</name>
      <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
      <mirrorOf>central</mirrorOf>
    </mirror>
  </mirrors>

</settings>

需要注意的是重启IDEA ,才能生效。

猜你喜欢

转载自blog.csdn.net/weixin_43538859/article/details/85120855