intellij-idea - IntelliJ Ultimate 忽略 spring boot application.properties

标签 intellij-idea spring-boot

今天我安装了 IntelliJ Ultimate 版本 2016.1.1 build 145.597。我后来做的是从 IntelliJ 社区版导入 May 项目。本项目基于 spring-boot 1.3.3。问题是,当我想在 IntelliJ Ultimate 中以某种方式运行我的应用程序时 application.properties 文件被忽略,它以默认的 spring 设置开始。当我在 IntelliJ 社区版或从命令行运行相同的项目时,一切正常。问题仅存在于 Ultimate 版中,当我添加和运行 spring boot run 配置时,如果我使用 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

项目结构 :
project structure

最佳答案

我对 IntelliJ Ultimate 2016.1.1 有同样的问题

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

我相信这个问题与 1.1 版本有关。 IntelliJ IDEA 2016.1.4 没有问题

关于intellij-idea - IntelliJ Ultimate 忽略 spring boot application.properties,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36847452/

相关文章:

java - 从 Maven Central 添加 Open JavaFX 包时出现 gradle 问题

java - 如何强制我的模板解析器对/mail/* 模板使用 ClassLoaderTemplateResolver

android - 在 Windows 8 上的 intellij 中找不到 USB 设备

从 JUnit 运行时 Spring 不会 Autowiring

java - Spring 启动 : How to override default properties in Unit tests

Spring 启动: Is this correct way to save a new entry which has ManyToOne relationship?

java - Spring Boot在保存后为关系实体返回空值

java - 读取 Artifact 描述符失败 : IntelliJ

java - 当其他类出现编译问题时,如何在IntelliJ IDEA中运行测试?

exception - 有什么简单的方法可以查看 Kotlin 函数抛出的异常?