Open x80486 opened 4 months ago
I just tried declaring the environment variables within the operating system (read: export VAR="value"
) and the application worked fine — so I'm certain it's an issue with the library.
Somehow, when I start the application with Gradle using ./gradlew bootRun
it doesn't read them from .env
.
Moreover, the problem is with the built-in environment variables that Spring Boot recognizes. I just remapped the variables and it works fine:
spring:
datasource:
driver-class-name: oracle.jdbc.OracleDriver
password: ${DATASOURCE_PASSWORD:?error}
type: oracle.ucp.jdbc.PoolDataSource
url ${DATASOURCE_URL:?error}
username: ${DATASOURCE_USERNAME:?error}
...but looks like anything starting with SPRING_
doesn't currently work.
I am facing the same issue. I believe the library somehow circumvents the Springs env to property resolution. Most probably introduces the environment variable too late in the resolution chain.
Hi, same issue here. The problem is not about SPRING_ prefixed environment variable but about the relaxed binding as described in #16
Description
I have a simple Spring Boot (3.2.2) application. I want to start using
spring-dotenv
for local development, so I started configuring the datasource to use environment variables instead, but somehow the application is not able to pick up the values from the.env
file.Environment