背景:当我们需要坐联调测试的时候,需要对接前端同事,则需要打包成jar包直接运行启动服务
需要将项目中的pom文件增加如下代码配置:
<build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId></plugin></plugins></build>
然后再执行Maven中的clean和package命令:
最终会打包成:xxxx.jar包
最后我们进入到对应jar包的目录执行命令:
java -jar xxxx.jar --activatedProperties=dev
即可启动完成