首页 / 资讯中心 / 文章详情

IDEA设置Maven 镜像

IDEA设置Maven 镜像 ★ FEATURED ARTICLE
第一步右键项目选择Maven-Create ‘settings.xml’(已经存在的话是Open ‘settings.xml’)第二步在settings.xml文件中增加阿里云镜像地址代码如下?xml version1.0 encodingUTF-8? settings xmlnshttp://maven.apache.org/SETTINGS/1.0.0 xmlns:xsihttp://www.w3.org/2001/XMLSchema-instance xsi:schemaLocationhttp://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd !-- 填写个人本地仓库路径 -- localRepositoryE:\zheng\develep\apache-maven-3.8.8\repo/localRepository !-- 镜像配置 -- mirrors !-- 阿里云镜像国内推荐首选 -- mirror idaliyun/id nameAliyun Maven Mirror/name urlhttps://maven.aliyun.com/repository/public/url mirrorOfcentral/mirrorOf /mirror !-- 华为云镜像备用 -- mirror idhuaweicloud/id nameHuaweiCloud Maven Mirror/name urlhttps://repo.huaweicloud.com/repository/maven//url mirrorOfcentral/mirrorOf /mirror !-- Maven中央仓库官方镜像终极备用 -- mirror idcentral/id nameMaven Central/name urlhttps://repo1.maven.org/maven2//url mirrorOfcentral/mirrorOf /mirror /mirrors !-- 性能优化配置 -- profiles profile idoptimize/id !-- 启用并行构建 -- properties maven.compile.forktrue/maven.compile.fork maven.test.forktrue/maven.test.fork /properties /profile /profiles !-- 激活优化配置 -- activeProfiles activeProfileoptimize/activeProfile /activeProfiles /settings第三步在pom.xml文件上右击选择Maven-Reimport(或者是Reload project )注意maven的全局配置默认路径是C:\Users[当前用户].m2\settings.xml本人默认路径是C:\Users\user\.m2\settings.xml。maven的配置路径可以在settings中的maven中修改
阅读完成 · 觉得有帮助?
咨询建站