增加打包成spring boot 可执行jar的相关maven配置,mvn clean package -Pboot
diff --git a/samples/client/pom.xml b/samples/client/pom.xml
index a8f4003..c680787 100644
--- a/samples/client/pom.xml
+++ b/samples/client/pom.xml
@@ -12,6 +12,9 @@
<artifactId>sample-client</artifactId>
<packaging>jar</packaging>
+ <properties>
+ <start-class>com.supwisdom.leaveschool.client.ClientApplication</start-class>
+ </properties>
<dependencies>
@@ -123,6 +126,8 @@
</dependencies>
<build>
+ <finalName>${project.artifactId}</finalName>
+
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -147,4 +152,18 @@
</plugins>
</build>
+ <profiles>
+ <profile>
+ <id>boot</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
</project>
diff --git a/samples/pom.xml b/samples/pom.xml
index d046338..6a22daf 100644
--- a/samples/pom.xml
+++ b/samples/pom.xml
@@ -68,6 +68,27 @@
</dependencies>
</dependencyManagement>
+
+
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>boot-repackage</id>
+ <phase>package</phase>
+ <goals>
+ <goal>repackage</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
<modules>
<module>foo</module>
diff --git a/samples/user/pom.xml b/samples/user/pom.xml
index 0b782b5..c478c2e 100644
--- a/samples/user/pom.xml
+++ b/samples/user/pom.xml
@@ -12,6 +12,10 @@
<artifactId>sample-user</artifactId>
<packaging>jar</packaging>
+ <properties>
+ <start-class>com.supwisdom.leaveschool.user.UserApplication</start-class>
+ </properties>
+
<dependencies>
<dependency>
@@ -96,6 +100,8 @@
</dependencies>
<build>
+ <finalName>${project.artifactId}</finalName>
+
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -120,4 +126,18 @@
</plugins>
</build>
+ <profiles>
+ <profile>
+ <id>boot</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
</project>