IntelliJ Ultimate 忽略 Spring Boot application.properties

koj*_*jas 6 intellij-idea spring-boot

今天我安装了 IntelliJ Ultimate 版本 2016.1.1 build 145.597。我后来所做的是从 IntelliJ Community Edition 导入可能的项目。本项目基于spring-boot 1.3.3。问题是,当我想在 IntelliJ Ultimate 中运行我的应用程序时,application.properties 文件会被忽略,并以默认的 spring 设置启动。当我在 IntelliJ Community Edition 中或从命令行运行相同的项目时,一切正常。当我添加和运行 spring boot 运行配置时,问题仅存在于 Ultimate 版本中,如果我使用 gradle 配置和 bootRun 任务,它就可以工作。

我之前没有使用过IntelliJ Ultimate。有谁知道可能出了什么问题?我浪费了 2 个小时在谷歌上搜索我的问题的解决方案,但我没有找到任何东西。

src/main/resources/application.properties的内容:

server.port=2081
server.ssl.key-store=cfg/certs/keystore.p12
server.ssl.key-store-password=dev
server.ssl.key-alias=alias
server.ssl.key-store-type=PKCS12

spring.datasource.url=jdbc:h2:file:./cfg/db/app;DB_CLOSE_ON_EXIT=FALSE
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
spring.jpa.hibernate.ddl-auto=none
Run Code Online (Sandbox Code Playgroud)

项目结构
项目结构

小智 4

我对 IntelliJ Ultimate 2016.1.1 有同样的问题

重新导入项目并删除现有项目对我有用。

我认为该问题与 1.1 版本有关。IntelliJ IDEA 2016.1.4 没有问题