maven添加镜像与常用配置
maven解压后conf文件夹有个 settings.xml 在这个文件中可以配置我们的maven
配置镜像:
找到<mirrors></mirrors>找到这个节点在节点中添加:
<!-- 配置阿里云 --> <mirror> <id>nexus-aliyun</id> <mirrorOf>*</mirrorOf> <name>Nexus aliyun</name> <url>http://maven.aliyun.com/nexus/content/groups/public</url> </mirror>
<!--开源中国镜像仓库--> <mirror> <id>CN</id> <name>OSChina Central</name> <url>http://maven.oschina.net/content/groups/public</url> <mirrorOf>central</mirrorOf><!--表示匹配原仓库的请求都转到镜像仓库--> </mirror>
配置默认仓库位置:
在<settings></settings>标签内加入
<localRepository>D:/maven/cangku</localRepository>
配置默认JAVA版本:
找到<profiles></profiles>标签在里面添加:
<profile> <id>jdk18</id> <activation> <activeByDefault>true</activeByDefault> <jdk>1.8</jdk> </activation> <properties> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion> </properties> </profile>
作者: 日落西风又在吹
出处:https://www.cnblogs.com/SimpleWu/p/9775150.html
本站使用「SimpleWu BY 4.0」创作共享协议,转载请在文章明显位置注明作者及出处。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步