maven的pom.xml的依赖,什么情况下可以不写版本号?
0
1640
风云剑客
2019/4/23 13:57:36
江苏 苏州
以前见过的pom.xml文件,依赖中都是必须有版本号的。但今天看到别人写的一个关于SpringBoot的demo,依赖中没有版本号,也没有任何问题,项目能正常跑起来。pom.xml:
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
netgloo
spring-boot-mysql-hibernate
0.0.1-SNAPSHOT
spring-boot-mysql-hibernate
Use MySQL in Spring Boot web application with Hibernate
org.springframework.boot
spring-boot-starter-parent
1.2.3.RELEASE
org.springframework.boot
spring-boot-starter-web
org.springframework.boot
spring-boot-starter-data-jpa
mysql
mysql-connector-java
UTF-8
netgloo.Application
1.7
org.springframework.boot
spring-boot-maven-plugin
我猜原因在这段代码里:
org.springframework.boot
spring-boot-starter-parent
1.2.3.RELEASE
但还是没想明白,为什么一些依赖如mysql连接可以忽略版本号?
有大触可以解释下吗?