建立父pom<groupId>org.wht</groupId> <artifactId>TestBoot03</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>pom</packaging>
将此处的packaging改为pom
将dependencies用dependencyManagement包起来并加入spring-boot-dependencies依赖,删除所有的包
<dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-dependencies -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>1.5.4.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
## 若要打包项目,在父pom加入spring-boot-maven-plugin依赖,然后在子项目的run as build 加入 clean package
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>org.TestBoot03.frist.MySpringBoot</mainClass>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>`
## 子项目的pom
加入spring-boot-maven-plugin
热部署加入`springloaded和spring-boot-devtools