配置maven

发布时间:2026/8/16 2:14:20

配置maven
配置maven1.下载地址Download Apache Maven – Maven2.下载maven压缩包并解压3.配置系统环境变量①右键此电脑 → 属性 → 高级系统设置 →环境变量②在系统变量不是用户变量点【新建】变量名MAVEN_HOME大写不能写错变量值maven 解压根目录例 D:\DevEnv\apache-maven-3.9.16③在系统变量找到Path编辑新建一条%MAVEN_HOME%\bin4.cmd mvn -v验证是否成功5.修改 settings.xml最重要本地仓库 阿里云镜像解决下载慢文件位置maven解压目录/conf/settings.xml用记事本 / VSCode 打开ps提前手动新建文件夹D:\DevEnv\apache-maven-3.9.16\Repository①设置本地仓库不占用 C 盘先在 D 盘新建文件夹例如D:\maven_repo用来存放下载的 jar 包。找到settings标签加入下面一行注意不要放到注释乱码localRepositoryD:\DevEnv\apache-maven-3.9.16\Repository/localRepository②添加阿里云镜像国内下载依赖飞快找到文件里的mirrors/mirrors标签把下面 mirror 复制粘贴进去aliyunmaven 阿里云公共仓库 https://maven.aliyun.com/repository/public central ![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/1ff9d01d4e4c4b88ab5197bd64e41b47.png)6.完整版?xml version1.0 encodingUTF-8?!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --!-- | 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 theyre all using the same Maven | installation). Its 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. | |--settingsxmlnshttp://maven.apache.org/SETTINGS/1.2.0xmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexsi:schemaLocationhttp://maven.apache.org/SETTINGS/1.2.0 https://maven.apache.org/xsd/settings-1.2.0.xsd!--本地仓库路径手动提前创建该文件夹--localRepositoryD:\DevEnv\apache-maven-3.9.16\Repository/localRepository!-- interactiveMode | This will determine whether maven prompts you when it needs input. If set to false, | maven will use a sensible default value, perhaps based on some other setting, for | the parameter in question. | | Default: true interactiveModetrue/interactiveMode --!-- offline | Determines whether maven should attempt to connect to the network when executing a build. | This will have an effect on artifact downloads, artifact deployment, and others. | | Default: false offlinefalse/offline --!-- pluginGroups | This is a list of additional group identifiers that will be searched when resolving plugins by their prefix, i.e. | when invoking a command line like mvn prefix:goal. Maven will automatically add the group identifiers | org.apache.maven.plugins and org.codehaus.mojo if these are not already contained in the list. |--pluginGroups!-- pluginGroup | Specifies a further group identifier to use for plugin lookup. pluginGroupcom.your.plugins/pluginGroup --/pluginGroups!-- proxies | This is a list of proxies which can be used on this machine to connect to the network. | Unless otherwise specified (by system property or command-line switch), the first proxy | specification in this list marked as active will be used. |--proxies!-- proxy | Specification for one proxy, to be used in connecting to the network. | proxy idoptional/id activetrue/active protocolhttp/protocol usernameproxyuser/username passwordproxypass/password hostproxy.host.net/host port80/port nonProxyHostslocal.net|some.host.com/nonProxyHosts /proxy --/proxies!-- servers | This is a list of authentication profiles, keyed by the server-id used within the system. | Authentication profiles can be used whenever maven must make a connection to a remote server. |--servers!-- server | Specifies the authentication information to use when connecting to a particular server, identified by | a unique name within the system (referred to by the id attribute below). | | NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are | used together. | server iddeploymentRepo/id usernamerepouser/username passwordrepopwd/password /server --!-- Another sample, using keys to authenticate. server idsiteServer/id privateKey/path/to/private/key/privateKey passphraseoptional; leave empty if not used./passphrase /server --/serversmirrors!--阿里云镜像--mirroridaliyunmaven/idname阿里云公共仓库/nameurlhttps://maven.aliyun.com/repository/public/urlmirrorOfcentral/mirrorOf/mirror!--maven3.9自带http拦截不要删除--mirroridmaven-default-http-blocker/idmirrorOfexternal:http:*/mirrorOfnamePseudo repository to mirror external repositories initially using HTTP./nameurlhttp://0.0.0.0//urlblockedtrue/blocked/mirror/mirrorsprofiles!--阿里云profile包含仓库与插件仓库--profileidaliyun/idrepositoriesrepositoryidaliyun-public/idurlhttps://maven.aliyun.com/repository/public/urlreleasesenabledtrue/enabled/releasessnapshotsenabledtrue/enabled/snapshots/repository/repositoriespluginRepositoriespluginRepositoryidaliyun-plugin/idurlhttps://maven.aliyun.com/repository/public/urlreleasesenabledtrue/enabled/releasessnapshotsenabledtrue/enabled/snapshots/pluginRepository/pluginRepositories/profile/profiles!--激活阿里云profile--activeProfilesactiveProfilealiyun/activeProfile/activeProfiles/settings

相关新闻

县域男性肌肤与肩颈养护避坑科普 —— 以罗田城西实体门店服务模式做参考

县域男性肌肤与肩颈养护避坑科普 —— 以罗田城西实体门店服务模式做参考

2026/8/16 2:14:20

一句话导读 县域男性普遍存在出油黑头、晒后色素沉着、长期劳作肩背僵硬等养护痛点,很多本地美容门店服务偏向女性群体,男生到店易产生尴尬体验。本文结合罗田城西经营多年的实体门店服务模式,系统拆解适合男性的无创养护方案、门店筛选标准与…

基于SpringBoot的乡村振兴旅游服务网站设计与实现源码+文档

基于SpringBoot的乡村振兴旅游服务网站设计与实现源码+文档

2026/8/16 2:04:20

温馨提示:本人主页置顶文章(点我)开头有 CSDN 平台官方提供的学长联系方式的名片! 温馨提示:本人主页置顶文章(点我)开头有 CSDN 平台官方提供的学长联系方式的名片! 温馨提示:本人主页置顶文章(点我)开头有 CSDN 平台…

Word/WPS页首段前间距失效的底层原理与六步根除方案

Word/WPS页首段前间距失效的底层原理与六步根除方案

2026/8/16 2:04:20

1. 问题现象与核心痛点:页首段落段前间距为何“失灵”?如果你经常用WPS或Word处理文档,尤其是需要严格遵循格式规范的论文、报告或公文,那么你很可能遇到过这个让人抓狂的问题:文档第一页的顶部,也就是页首…

小说下载器 - 你的网文自由神器!

小说下载器 - 你的网文自由神器!

2026/8/16 4:34:26

📚 小说下载器🎯 它能干嘛 1 搜书:一键全站搜 自动并发搜索你配置的所有书源,多站结果自动去重。输入书名,坐等小说自己排队。 2 下载:快、稳、还能断点续传 多线程并发下载,5 个章节同时跑&…

HTTP到HTTPS强制跳转:301重定向与HSTS配置实战指南

HTTP到HTTPS强制跳转:301重定向与HSTS配置实战指南

2026/8/16 4:34:26

1. 问题场景:从“不安全”到“安全”的强制跳转 如果你是一名网站管理员、开发者,或者只是对自己访问的网站有好奇心,那么你一定遇到过这种情况:在浏览器的地址栏里,你手动输入了一个以 http:// 开头的网址&#xf…

AI Agent实战:从零构建智能体与高频面试题深度解析

AI Agent实战:从零构建智能体与高频面试题深度解析

2026/8/16 4:34:26

这次我们来看一个关于 AI Agent 项目实战和 AI 面试题的综合性话题。对于开发者而言,无论是想亲手搭建一个能自主执行任务的智能体,还是准备在求职面试中应对层出不穷的 AI 相关问题,这都是当前最需要掌握的核心技能。本文不会空谈概念&#…

Ubuntu 22.04 Intel平台编译ALAMODE:从环境配置到性能调优完整指南

Ubuntu 22.04 Intel平台编译ALAMODE:从环境配置到性能调优完整指南

2026/8/16 4:34:26

这次我们来看一个在 Ubuntu 22.04 系统上,针对 Intel 平台编译安装 ALAMODE 的完整流程。ALAMODE 是一个用于计算晶格动力学性质(如声子谱、热导率)和原子间势函数的开源软件包,在材料科学和凝聚态物理领域有重要应用。对于需要在…

HTTP状态码到底是个啥?一文看懂200、301、302、404、500

HTTP状态码到底是个啥?一文看懂200、301、302、404、500

2026/8/16 4:34:26

一、开头:你肯定见过这些数字‌上网的时候,你肯定见过“404 Not Found”这个页面。或者,你打开一个网站,半天没反应,最后蹦出来一个“500 Internal Server Error”。这些数字,就是HTTP状态码。说白了&#…

如何把某一个 commit 合并到当前分支?Git cherry-pick 完整教程

如何把某一个 commit 合并到当前分支?Git cherry-pick 完整教程

2026/8/16 4:24:26

如何把某一个 commit 合并到当前分支?Git cherry-pick 完整教程 在实际开发中,我们经常会遇到这样的情况:另一个分支中有很多提交,但当前分支只需要其中某一个 commit。 这种情况下,没有必要把整个分支 merge 进来&…

【文章复现】非线性值迭代自适应动态规划(ADP):离散时间非线性系统的策略迭代自适应动态规划算法研究附Matlab代码

【文章复现】非线性值迭代自适应动态规划(ADP):离散时间非线性系统的策略迭代自适应动态规划算法研究附Matlab代码

2026/8/16 0:04:13

✅作者简介:热爱科研的Matlab仿真开发者,擅长毕业设计辅导、数学建模、数据处理、建模仿真、程序设计、完整代码获取、论文复现及科研仿真。🍎 往期回顾关注个人主页:Matlab科研工作室👇 关注我领取海量matlab电子书和…

【双层规划,节点出清价,绿证交易,CVaR方法】两级电力市场环境下计及风险的省间交易商最优购电模型附Matlab代码

【双层规划,节点出清价,绿证交易,CVaR方法】两级电力市场环境下计及风险的省间交易商最优购电模型附Matlab代码

2026/8/16 0:04:13

✅作者简介:热爱科研的Matlab仿真开发者,擅长毕业设计辅导、数学建模、数据处理、建模仿真、程序设计、完整代码获取、论文复现及科研仿真。🍎 往期回顾关注个人主页:Matlab科研工作室👇 关注我领取海量matlab电子书和…

隐式mpc+自适应mpc+时变mpc,线性时变模型预测控制附Simulink仿真

隐式mpc+自适应mpc+时变mpc,线性时变模型预测控制附Simulink仿真

2026/8/16 0:04:13

✅作者简介:热爱科研的Matlab仿真开发者,擅长毕业设计辅导、数学建模、数据处理、建模仿真、程序设计、完整代码获取、论文复现及科研仿真。🍎 往期回顾关注个人主页:Matlab科研工作室👇 关注我领取海量matlab电子书和…

【文章复现】非线性值迭代自适应动态规划(ADP):离散时间非线性系统的策略迭代自适应动态规划算法研究附Matlab代码

【文章复现】非线性值迭代自适应动态规划(ADP):离散时间非线性系统的策略迭代自适应动态规划算法研究附Matlab代码

2026/8/16 0:04:13

✅作者简介:热爱科研的Matlab仿真开发者,擅长毕业设计辅导、数学建模、数据处理、建模仿真、程序设计、完整代码获取、论文复现及科研仿真。🍎 往期回顾关注个人主页:Matlab科研工作室👇 关注我领取海量matlab电子书和…

【双层规划,节点出清价,绿证交易,CVaR方法】两级电力市场环境下计及风险的省间交易商最优购电模型附Matlab代码

【双层规划,节点出清价,绿证交易,CVaR方法】两级电力市场环境下计及风险的省间交易商最优购电模型附Matlab代码

2026/8/16 0:04:13

✅作者简介:热爱科研的Matlab仿真开发者,擅长毕业设计辅导、数学建模、数据处理、建模仿真、程序设计、完整代码获取、论文复现及科研仿真。🍎 往期回顾关注个人主页:Matlab科研工作室👇 关注我领取海量matlab电子书和…

隐式mpc+自适应mpc+时变mpc,线性时变模型预测控制附Simulink仿真

隐式mpc+自适应mpc+时变mpc,线性时变模型预测控制附Simulink仿真

2026/8/16 0:04:13

✅作者简介:热爱科研的Matlab仿真开发者,擅长毕业设计辅导、数学建模、数据处理、建模仿真、程序设计、完整代码获取、论文复现及科研仿真。🍎 往期回顾关注个人主页:Matlab科研工作室👇 关注我领取海量matlab电子书和…

摆脱论文困扰!盘点2026年全网爆红的的AI论文写作工具

摆脱论文困扰!盘点2026年全网爆红的的AI论文写作工具

2026/8/15 1:04:46

一天写完毕业论文在2026年已不再是天方夜谭。2026年最炸裂、实测能大幅提速的AI论文写作工具,覆盖选题构思、文献整理、内容生成、格式排版等核心场景,真正帮你高效搞定论文难题。 一、全流程王者:一站式搞定论文全链路(一天定稿首…

导师推荐!2026最新AI论文工具测评与实用推荐

导师推荐!2026最新AI论文工具测评与实用推荐

2026/8/15 10:10:27

2026年真正好用的AI论文工具,核心看生成的论文质量、低AI味、格式正确、学术适配四大指标。综合实测,千笔AI、ThouPen、豆包、DeepSeek、Grammarly 是当前最值得推荐的梯队,覆盖从免费到付费、从中文到英文、从文科到理工的全场景需求。 一、…

告别游戏崩溃:XCOM 2模组管理器的智能革命

告别游戏崩溃:XCOM 2模组管理器的智能革命

2026/8/14 19:35:14

告别游戏崩溃:XCOM 2模组管理器的智能革命 【免费下载链接】xcom2-launcher The Alternative Mod Launcher (AML) is a replacement for the default game launchers from XCOM 2 and XCOM Chimera Squad. 项目地址: https://gitcode.com/gh_mirrors/xc/xcom2-lau…