在pom.xml里编写
src/main/resources true test true ./profiles/score-test.properties uat ./profiles/score-uat.properties
src/main/resources/application.properties
server.port=@server.port@ spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.url=@spring.datasource.url@ spring.datasource.username=@spring.datasource.username@ spring.datasource.password=@spring.datasource.password@ mybatis.configuration.map-underscore-to-camel-case=true mybatis.configuration.jdbc-type-for-null=NULL logging.config=classpath:logback.xml spring.main.allow-bean-definition-overriding=true
在score-test.properties和score-uat.properties中根据环境的不同添加具体的参数,比如数据库地址和端口等等。
package后在target/classes/application.properties中可以看到选择了哪个properties就会显示哪个properties里参数的值



