IntelliJ Ultimate忽略Spring Boot application.properties [英] IntelliJ Ultimate ignores spring boot application.properties

查看:98
本文介绍了IntelliJ Ultimate忽略Spring Boot application.properties的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天,我已经安装了IntelliJ Ultimate 2016.1.1版内部版本145.597.我后来做的是从IntelliJ Community Edition导入may项目.该项目基于spring-boot 1.3.3.问题是,当我想在IntelliJ Ultimate中运行我的应用程序时,application.properties文件将以某种方式被忽略,并以默认的spring设置开始.当我在IntelliJ Community Edition中或从命令行运行相同的项目时,一切正常.仅当我添加并运行spring boot run配置时,问题才出现在Ultimate Edition中.如果我使用gradle配置和bootRun任务,它将起作用.

Today I've install IntelliJ Ultimate version 2016.1.1 build 145.597. What I did later, was import of may project from IntelliJ Community Edition. This project is based on spring-boot 1.3.3. The problem is that when I want to run my application in IntelliJ Ultimate somehow application.properties file is ignored and it starts with default spring settings. When I'm running the same project in IntelliJ Community Edition or from command line everything works fine. Problem exists only in Ultimate edition when I'm adding and running spring boot run configuration, if I use gradle configuration and bootRun task it works.

我在IntelliJ Ultimate之前没有使用过. 有谁知道可能是错的吗?我浪费了2个小时的时间来寻找解决问题的方法,但没有找到任何东西.

I didn't use before IntelliJ Ultimate. Does anyone know what could be wrong? I wasted 2 hours googling for solution of my problem but I didn't find anything.

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

项目结构:

推荐答案

对于IntelliJ Ultimate 2016.1.1,我也遇到了同样的问题

I had same issue for IntelliJ Ultimate 2016.1.1

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

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

I believe the issue is pertinent with 1.1 version. Didn't had issue with IntelliJ IDEA 2016.1.4

这篇关于IntelliJ Ultimate忽略Spring Boot application.properties的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆