设置上下文路径context-path不生效:
springboot 2.0之前的语法:
server.context-path:/xx
2.0之后的语法:
server.servlet.context-path: /xx
在配置yml时,报错如下:
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)
原因是使用了特殊字符导致扫描出错。
解决的办法是将报错的value用单引号或双引号包裹起来
在项目springboot项目中引入springcloud总是跑不起来,
在经过各种控制变量发测试之后最后锁定在springboot版本上,原来springboot和springcloud的版本有比较大的兼容问题。
兼容关系如图:
然后在此处修改对应的版本号就彳亍了