idea 修改maven setting文件不生效解决方案
原因
idea 中的maven 配置的自定义 XXX_settings.xml 文件 会与 MAVEN_HOME/conf 中的 settings.xml 文件整合。
方案
1.直接修改 MAVEN_HOME/conf/settings.xml
2.如果需要自定义,先将 MAVEN_HOME/conf/settings.xml 中的 <mirrors> 中的 <mirrorOf> 的 * 去了
mirrorOf=“*”时镜像所有的repositoryId,包括repositories和pluginRepositories。如果你需要某个jar就会从镜像mirrorOd配置的地址去下载这个jar。其他配置的repostory都没用。
注
默认settings.xml 注释:
<!-- | This is the configuration file for Maven. It can be specified at two levels: | | 1. User Level. This settings.xml file provides configuration for a single user, | and is normally provided in ${user.home}/.m2/settings.xml. | | NOTE: This location can be overridden with the CLI option: | | -s /path/to/user/settings.xml | | 2. Global Level. This settings.xml file provides configuration for all Maven | users on a machine (assuming they're all using the same Maven | installation). It's normally provided in | ${maven.conf}/settings.xml. | | NOTE: This location can be overridden with the CLI option: | | -gs /path/to/global/settings.xml | | The sections in this sample file are intended to give you a running start at | getting the most out of your Maven installation. Where appropriate, the default | values (values used when the setting is not specified) are provided. | |-->
优先级 user level > global level
user level path: ${user.home}/.m2/settings.xml
global level path:${maven.conf}/settings.xml.
这两个路径可能存在 setting 配置文件,注意调整
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 零经验选手,Compose 一天开发一款小游戏!
· 通过 API 将Deepseek响应流式内容输出到前端
· 因为Apifox不支持离线,我果断选择了Apipost!