idea 启动springboot项目提示ScannerException:character ‘@‘ that cannot start any token
这是因为, spring-boot-starter-parent自带自动化的资源过滤,那什么是资源过滤呢。我们为本地环境和开发环境配置了不同的profile,在我们的代码里,就可以使用@xxx@来引用到属性,例如上面例子中,我们默认开启的环境是 带有 activeByDefault = true 的local环境,所以@profileActive@读到的是 profile id = local 的文件下,profileActive的值,即local。启动项目,一切正常,这是因为我们这里手动配置了资源过滤。
转载
2024-06-11 16:43:15 ·
18 阅读 ·
1 评论