1.父工程:
创建工程,骨架simple,类型pom,修改父类pom.xml:
包含spring-boot-starter-parent的repo库,需添加<dependencyManagement>;
添加<type>pom</type>;
添加<scope>import</scope>;
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.1.4.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
添加jdk版本:
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
2.子工程:
创建工程,父工程上点击右键,maven工程,maven module:
父类中的<type>和<scope>,可以使得子类中的repo不添加version。