下载解压
在d盘建立名为maven的文件夹进apache-maven-38.4-bin-zip解压到“D:\maven”中,repo是后期生成的现在不用管
修改D:\maven\conf\settings.xml,配置国内镜像,jdk17版本
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 https://maven.apache.org/xsd/settings-1.2.0.xsd">
<localRepository>D:/maven/repo</localRepository>
<mirrors>
<mirror>
<id>aliyunmaven</id>
<mirrorOf>*</mirrorOf>
<name>阿里云公共仓库</name>
<url>https://maven.aliyun.com/repository/public</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>jdk-17</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>17</jdk>
</activation>
<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.compilerVersion>17</maven.compiler.compilerVersion>
</properties>
</profile>
</profiles>
</settings>
配置maven环境变量
在项目中配置
配置当前项目maven的使用;打开idea File->settings...->Build,Execution,Deployment->Build Tools->Maven。修改Maven hone path: 勾选override User settings file: Local repository: 勾选User settings from .mvn/naven.config
点击Apply 点击OK
配置创建新项目mevn的使用,打开idea File->New Projetcs Setup->Settings for new Projetcs...->Build,Execution,Deployment->Build Tools->Maven。修改importing中的JDK for imorter:
点击Apply 点击OK
修改Ruuner中的JRE: 点击Apply 点击OK
**用疑问可以私信看到会回复 **
版权归原作者 wzt_java 所有, 如有侵权,请联系我们删除。