VsCode-WSL的Maven插件仓库配置

2020-02-26  本文已影响0人  LiarMaiq

使用VsCode安装了Maven插件以后,在插件安装目录(C:\Users\用户名\.vscode\extensions)下并不会存在配置文件settings.xml,因此无法直接通过编辑该文件配置Maven的仓库。
使用VsCode的设置,找到Maven的配置项Java.Configuration.Maven


在其中输入你的settings.xml文件路径(注意:如果是在WSL下,需要使用Linux系统文件路径),settings.xml文件可以从安装版的Maven目录中拷贝一份,并修改其中仓库部分的配置内容,配置完成后需要重启VsCode。
<?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">
  <pluginGroups></pluginGroups>
  <proxies></proxies>
  <servers></servers>
  <mirrors>
    <mirror>
      <id>aliyunmaven</id>
      <mirrorOf>central</mirrorOf>
      <name>aliyun maven</name>
      <url>https://maven.aliyun.com/repository/public</url>
    </mirror>
  </mirrors>
  <profiles></profiles>
</settings>
上一篇 下一篇

猜你喜欢

热点阅读