Failed to run SB using Eclipse IDE run command using environment variables in application properties
Since GitGuardian noticed that I push hardcoded password I decided to create
.env
files. However the application cannot load these variables values from the shell context and instead it is using placeholders and then fail to load the database and thus the application. What should I do? I have such application properties:
But when I start the application directly from Eclipse IDE by choosing command: Run as.. > Spring Boot App
then it starts and encounters errors:
What to do?3 Replies
⌛
This post has been reserved for your question.
Hey @Tomasm21! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
The application successfully launches on bash terminal using command:
When in terminal I load source for env:
$ source .env
it is acquired well.
I can echo my variables:
But if I launch my app using ./mvnw spring-boot:run
then it finds same Caused by: java.sql.SQLException: Access denied for user '${DATABASE_USERNAME}'@'localhost' (using password: YES)
errors.
But while developing I used to launch directly on Eclipse by right clicking the main class file and selecting Run as... > Spring Boot App
.
Why by default my environment variables cannot be read?
I'm on Windows 10 OS.💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.