Maven的relativePath
浅谈Maven的relativePath
https://blog.csdn.net/zysh888/article/details/105089895
Maven学习总结(55)——pom.xml 中 relativePath 属性的作用
https://zhanghaiyang.blog.csdn.net/article/details/121510375
Maven pom中的parent.relativePath的作用(官网说明)
https://blog.csdn.net/ipanyuhui/article/details/121531740
Maven 继承父工程时的relativePath标签解析(重要)
https://blog.csdn.net/inthat/article/details/108147303
<relativePath/>设定一个空值将始终从仓库中获取,不从本地路径获取。
查找顺序:relativePath元素中的地址–本地仓库–远程仓库
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.2.4.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent>
<?xml version="1.0" encoding="UTF-8"?> <project 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 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.2.2.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>cn.hjljy.springboot</groupId> <artifactId>dubbo_nacos_demo</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>pom</packaging> <name>dubbo_nacos_demo</name> <description>Demo project for dubbo_nacos</description> <modules> <module>dubbo_nacos_api</module> <module>dubbo_nacos_service</module> <module>dubbo_nacos_customer</module> </modules> <properties> <java.version>1.8</java.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <!-- dubbo 2.7.x引入--> <dependency> <groupId>org.apache.dubbo</groupId> <artifactId>dubbo-spring-boot-starter</artifactId> <version>2.7.5</version> </dependency> <!-- nacos 2.7.x引入--> <dependency> <groupId>org.apache.dubbo</groupId> <artifactId>dubbo-registry-nacos</artifactId> <version>2.7.5</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> <exclusions> <exclusion> <groupId>org.junit.vintage</groupId> <artifactId>junit-vintage-engine</artifactId> </exclusion> </exclusions> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> </project>
Maven 继承父工程时的relativePath标签解析(重要)
https://blog.csdn.net/inthat/article/details/108147303
<parent> <groupId>com.ctrip.framework.apollo</groupId> <artifactId>apollo</artifactId> <version>1.6.1</version> <relativePath>../pom.xml</relativePath> </parent>