1

IDEA 搭配 springboot 的 spring profile 问题

 2 years ago
source link: https://www.v2ex.com/t/810379
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

V2EX  ›  Java

IDEA 搭配 springboot 的 spring profile 问题

  MonkeyCoder · 1 小时 3 分钟前 · 199 次点击

新搞了一个工程.配置了多环境.然后 idea 只能够识别到 application.yml 和 application-prod.yml 这两个文件,application-dev.yml 是无法识别的.网上找了一圈都不行.有大佬知道吗?

10 条回复    2021-10-25 16:35:33 +08:00

imiem

imiem   58 分钟前

idea 无法识别是什么意思?文件在 idea 中看不到?

MonkeyCoder

MonkeyCoder   54 分钟前

@imiem #1 就是文件图标不是绿叶.就是普通的文本文件,没有代码高亮和代码提示,但是 application-prod 是没问题的

longchen888

longchen888   52 分钟前

file -> invalidate caches/restart 试试

micean

micean   46 分钟前

你先确认 target/classes 里有没有你想要的 yml 文件

mgzu

mgzu   30 分钟前

2021.2.3 ,application-* 文件识别没有问题。idea 有问题,我一般都是以下方法尝试解决
1. invalidate caches
2. 删除 .idea 、iml 文件,重新打开项目

dejavuwind

dejavuwind   29 分钟前

这还真没遇到过,应该就是编译缓存的问题 不行的话试试重启?基于 prod 再新建一个试试?

xiao109

xiao109   8 分钟前

那可能是你文件的后缀有问题,建议删除重建

wolfie

wolfie   5 分钟前

命令行启动没问题?

IDEA Edit Configurations ,检查一下 VM options 、Program Arguments 、Active Profiles 都可能设置参数。

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK