application.yaml
spring:
profiles:
active: @profileActive@
<profiles>
<profile>
<id>dev</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<profileActive>dev</profileActive>
</properties>
</profile>
<profile>
<id>test</id>
<properties>
<profileActive>test</profileActive>
</properties>
</profile>
<profile>
<id>prod</id>
<properties>
<profileActive>prod</profileActive>
</properties>
</profile>
</profiles>
生产环境
mvn clean package -Pprod
这些都没有问题,但是在idea里面启动时报错
Caused by: org.yaml.snakeyaml.scanner.ScannerException: while scanning for the next token
found character '@' that cannot start any token. (Do not use @ for indentation)
in 'reader', line 3, column 13:
active: @profileActive@
Caused by: org.yaml.snakeyaml.scanner.ScannerException: while scanning for the next token
found character '@' that cannot start any token. (Do not use @ for indentation)
in 'reader', line 3, column 13:
active: @profileActive@
idea是加vm和程序参数都是不行,请问下如果解决这个问题
<p>spring:<br>
profiles:
active: @profileActive@
感觉这个是多余的
回复 <a class="referer" target="_blank">@Eric_林</a> : 同样的配置,同事的电脑是完全可以正常运行的,
这个@是让maven用的,点位符 mvn -P
@profileActive@ 引用有问题 默认不是这样引用的·····springboot 多环境不需要这样配置····直接体现在yml配置文件中··
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。