maven是一个项目构建工具,maven可以完成项目打包,在线管理依赖包等。

maven介绍参考:https://www.runoob.com/maven/maven-tutorial.html

maven安装参考:https://blog.csdn.net/qq_42881421/article/details/82900849

maven修改镜像源参考:https://www.runoob.com/maven/maven-repositories.html

maven修改默认仓库地址参考:https://www.cnblogs.com/doudou-taste/p/9022979.html

创建maven项目:

点击new:

java,创建maven项目,以及maven下载依赖包

1:选择maven project,点击下一步

java,创建maven项目,以及maven下载依赖包

2:勾选前面2个,点击下一步

java,创建maven项目,以及maven下载依赖包

3:填写group Id和artifact Id,点击结束

java,创建maven项目,以及maven下载依赖包

java,创建maven项目,以及maven下载依赖包

4:创建成功后的目录结构:

java,创建maven项目,以及maven下载依赖包

java,创建maven项目,以及maven下载依赖包

maven下载log4j依赖包:

java,创建maven项目,以及maven下载依赖包

1:在pom.xml添加如下标签:

java,创建maven项目,以及maven下载依赖包

2:去maven仓库查找版本:

仓库地址如下:https://mvnrepository.com/

搜索log4j搜到以下内容,点击第2个log4j

java,创建maven项目,以及maven下载依赖包

选择版本

java,创建maven项目,以及maven下载依赖包

选择要下载的版本,复制依赖描述:

java,创建maven项目,以及maven下载依赖包

3:放到pom.xml里面:

java,创建maven项目,以及maven下载依赖包

保存之后就会自动下载,下载成功后如图:

java,创建maven项目,以及maven下载依赖包

相关文章:

  • 2021-06-20
  • 2021-12-11
  • 2022-12-23
  • 2022-12-23
  • 2021-05-14
  • 2021-07-31
  • 2021-11-18
  • 2021-12-29
猜你喜欢
  • 2021-08-31
  • 2021-04-20
  • 2022-12-23
  • 2022-12-23
  • 2021-07-29
  • 2021-05-04
相关资源
相似解决方案