微服务 教程
1085个小节阅读:195.9k
C语言快速入门
JAVA全系列 教程
面向对象的程序设计语言
Python全系列 教程
Python3.x版本,未来主流的版本
人工智能 教程
顺势而为,AI创新未来
大厂算法 教程
算法,程序员自我提升必经之路
C++ 教程
一门通用计算机编程语言
微服务 教程
目前业界流行的框架组合
web前端全系列 教程
通向WEB技术世界的钥匙
大数据全系列 教程
站在云端操控万千数据
AIGC全能工具班
A A
White Night
本地仓库的默认位置是${user.dir}/.m2/repository
,${user.dir}
表示 windows用户目录,我们可以通过修改${MAVEN_HOME}\conf\settings.xml
,修改本地仓库的位置。
在<settings>
中添加如下标签:
<!-- 本地仓库路径 -->
<localRepository>F://repository</localRepository>
由于中央仓库访问速度较慢,可以配置镜像代理中央仓库的下载请求。在<settings>
下的<mirrors>
中添加如下标签即可配置镜像:
xxxxxxxxxx
<mirror>
<!-- 指定镜像ID -->
<id>nexus-aliyun</id>
<!-- 匹配中央仓库。-->
<mirrorOf>central</mirrorOf>
<!-- 指定镜像名称 -->
<name>Nexus aliyun</name>
<!-- 指定镜像路径 -->
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
创建maven项目的时候,默认使用的JDK是1.5版本,验证语法、编译、运行时都会按照JDK1.5操作,这样就有很多语法无法使用。我们本机安装的JDK是JDK11,可以配置maven按照JDK11创建项目。
在<settings>
下的<profiles>
中添加如下标签即可配置JDK版本:
xxxxxxxxxx
<profile>
<id>jdk11</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>11</jdk>
</activation>
<properties>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.compilerVersion>11</maven.compiler.compilerVersion>
</properties>
</profile>
1. 在Maven中,配置本地仓库的标签为
A <localRepository>
B <Repository>
C <local>
D <properties>
2. 在Maven中,配置镜像的标签为
A <profile>
B <mirror>
C <settings>
D <properties>
1=>A 2=>B