官方文档链接地址:http://docs.spring.io/spring-boot/docs/1.3.0.BUILD-SNAPSHOT/maven-plugin/index.html
第一部分
Spring Boot Maven Plugin提供了Spring Boot的Maven支持,允许你打包可执行文件和war文件,并且就地运行。
1、Spring Boot Plugin有如下目标:
1.spring-boot:run 运行Spring Boot应用
2.spring-boot:repackage 重新打包jar/war包为可执行包
3.spring-boot:start 和spring-boot:stop 管理Spring Boot 应用的生命周期(即集成测试)
2、 springboot 项目使用 pom.xml 中 build 节点
<build>
<finalName>${project.name}</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<finalName>${project.build.finalName}</finalName>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<target>${maven.compiler.target}</target>
<source>${maven.compiler.source}</source>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>