<plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <!--这里写上main方法所在类的路径--> <configuration> <mainClass>com.mob.marketing.support.MarketingSupportApplication</mainClass> </configuration> <executions> <execution> <goals> <goal>repackage</goal> </goals> </execution> </executions> </plugin>
配置中增加这个
然后执行:mvn -pl xxx -am clean package -U -Dmaven.test.skip=true -Ptest 打包
P代表(Profiles配置文件)-P test将触发test环境的profile配置
-Dmaven.test.skip 不执行test
-pl 用于子模块打包
参数 | 全称 | 释义 | 说明 |
-pl | --projects | Build specified reactor projects instead of all projects | 选项后可跟随{groupId}:{artifactId}或者所选模块的相对路径(多个模块以逗号分隔) |
-am | --also-make | If project list is specified, also build projects required by the list | 表示同时处理选定模块所依赖的模块 |
-amd | --also-make-dependents | If project list is specified, also build projects that depend on projects on the list | 表示同时处理依赖选定模块的模块 |
-N | --Non-recursive | Build projects without recursive | 表示不递归子模块 |
-rf | --resume-from | Resume reactor from specified project | 表示从指定模块开始继续处理 |