1. 创建配置文件 在 src/main/resources 目录下新建 env.properties 作为配置文件, 并写入 host=@host@ 2. 加入 profiles 标签 在 pom.xml 中加入以下内容 <profiles> <profile> <id>test</id> <activation> <!--指定该环境为默认配置--