微服务springboot笔记(3)

       在开发过程中一般会有很多配置文件,例如分为开发,生产,测试等,每个测试文件的内容可能都不同,例如开发用的端口是8001,生产用的是8002等,那么在打包程序时如何设置选择呢。

       

例如复制配置文件并修改之后,

application.properties文件的内容如下

spring.application.name=/quickstart
server.context-path=/qs

server.port=8082

custom.group = 12345
custom.team = 67890

spring.profiles.active=$spring.profiles.active$

我们用打包时用maven命令 mvn clean install -P dev / prod / local / test / 

打包完成后会出现BUILD SUCCESS

然后更新下 target目录,即可看到生成的项目jar包.

这些打包很简单,关键在于pom.xml文件的配置,每个人的配置方法可能都不同。这里就不贴上我的配置文件了。

猜你喜欢

转载自blog.csdn.net/yao_hou/article/details/86603498