Reputation: 132
I am new in Spring Boot. Trying a set my database credentials in environment variable using
export SPRING_DATASOURCE_USERNAME=scott
export SPRING_DATASOURCE_PASSWORD=tiger
spring:
datasource:
type: org.apache.tomcat.jdbc.pool.DataSource
url: jdbc:oracle:thin:@ip:port/SID
username: ${SPRING_DATASOURCE_USERNAME}
password: ${SPRING_DATASOURCE_PASSWORD}
getting invalid username/password error.
Upvotes: 0
Views: 5109
Reputation: 44980
You are setting the environment variables in the shell using export
directive however you are running the application from within IntelliJ IDEA.
If you use IntelliJ to start the application you should set the environment variable directly in the IntelliJ runtime configuration, as shown on picture below:
You could add your exports to .profile
(or .bashrc
) file but this would force you to restart IntelliJ each time this file is modified.
Upvotes: 3