找到并打开IDEA内置Maven配置文件
不是IDEA内置的打开自己安装maven目录下的conf-setings.xml
打开setings.xml这个文件
配置阿里云镜像仓库
把下面这段配置加上
<mirror>
<!--指定镜像ID(可自己改名)-->
<id>nexus-aliyun</id>
<!--匹配中央仓库(阿里云的仓库名称,不可以自己起名,必须这么写)-->
<mirrorOf>central</mirrorOf> <!--指定镜像名称(可自己改名) -->
<name>Nexus aliyun</name>
<!--指定镜像路径(镜像地址)-->
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
配置本地仓库
配上
<localRepository>C:\Users\Ben\.m2\repository</localRepository>
配置运行编码
再配上
<profile>
<!--settings.xml中的id不能随便起的-->
<!--告诉maven我们用jdk19-->
<id>jdk-19</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>19</jdk>
</activation>
<properties>
<!--配置編洋器信息-->
<maven.compiler.source>19</maven.compiler.source>
<maven.compiler.target>19</maven.compiler.target>
<maven.compiler.compilerVersion>19</maven.compiler.compilerVersion>
</properties>
</profile>