intellij idea:配置maven 3.8.2(intellij idea 2021.2)
一,配置Settings for New Projects…
File->New Project Setup->Settings for New Projects…
->Build,Execution,Deployment->Build Tools->Maven
说明:刘宏缔的架构森林是一个专注架构的博客,
网站:https://blog.imgtouch.com
本文: https://blog.imgtouch.com/index.php/2023/05/27/intellij-idea-pei-zhi-maven-3-8-2-intellij-idea-2021-2/
对应的源码可以访问这里获取: https://github.com/liuhongdi/
说明:作者:刘宏缔 邮箱: 371125307@qq.com
二,进行配置
指定三个路径:
Maven Home Path : maven的路径
User settings file: 配置文件
Local repository: 仓库的路径
如图:
然后点apply应用,
再点OK保存
三,测试maven效果
创建一个spring项目,看Local repository能否保存java库
1,创建spring项目的所在目录:
liuhongdi@lhdpc:/usr/local/source$ mkdir /data/springboot
2,创建项目:
点击 New Project 按钮
从左侧菜单选择: Spring Initializr
如图:
进行设置:如图:
点击Next 按钮
选择spring web作为依赖,
然后点击 Finish
四,查看maven的仓库目录,看对maven的配置是否生效?
可见已生效
五,查看intellij idea的版本:
Help->About
如图:
六,查看maven的版本:
root@lhdpc:/usr/local/source# mvn --version Apache Maven 3.8.2 (ea98e05a04480131370aa0c110b8c54cf726c06f) Maven home: /usr/local/soft/apache-maven-3.8.2 Java version: 16.0.2, vendor: Oracle Corporation, runtime: /usr/local/soft/jdk-16.0.2 Default locale: zh_CN, platform encoding: UTF-8 OS name: "linux", version: "5.11.0-31-generic", arch: "amd64", family: "unix"