Maven02- 项目聚合&依赖管理&项目构建

pom.xml 文件

一个maven工程都有一个pom.xml文件,通过pom.xml文件定义项目的坐标、项目依赖、项目信息、插件目标等。

定义maven坐标

​ 每个maven工程都需要定义本工程的坐标,坐标是maven对jar包的身份定义,比如:入门程序的坐标定义如下:

<!--项目名称,定义为组织名+项目名,类似包名-->

<groupId>org.westos</groupId>

<!-- 模块名称 -->

<artifactId>maven-first</artifactId>

<!-- 当前项目版本号,snapshot为快照版本即非正式版本,release为正式发布版本 -->

<version>0.0.1-SNAPSHOT</version>

<packaging > :打包类型

​            jar:执行package会打成jar包

​            war:执行package会打成war包

​          pom :用于maven工程的继承,通常父工程设置为pom

导入依赖常见问题

Maven项目中Failure to transfer问题以及解决方法

提示错误如下

Description	Resource	Path	Location	Type
Failure to transfer org.springframework.boot:spring-boot-maven-plugin:pom:2.1.3.RELEASE from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.springframework.boot:spring-boot-maven-plugin:pom:2.1.3.RELEASE from/to central (https
  • 5
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值