共计 1264 个字符,预计需要花费 4 分钟才能阅读完成。
主我的项目:
<packaging>pom</packaging>
打包配置:
<!-- 指定应用 maven 打包 -->
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<skipTests>true</skipTests> <!-- 默认关掉单元测试 -->
</configuration>
</plugin>
</plugins>
</build>
子项目,boot 入口模块:
<packaging>jar</packaging>
<parent>
<groupId>com.kuma.platform</groupId>
<artifactId>kuma-boot</artifactId>
<version>1.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<!-- 指定该 Main Class 为全局的惟一入口 -->
<mainClass>com.kuma.platform.MainApplication</mainClass>
<layout>ZIP</layout>
<!--fork: 如果没有该项配置, 整个 devtools 不会起作用 -->
<fork>true</fork>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal><!-- 能够把依赖的包都打包到生成的 Jar 包中 -->
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
其余子模块:
<packaging>jar</packaging>
<parent>
//....
<version>1.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
正文完
发表至: springboot
2022-10-16