0

I need to set applcation properties variable with system variable Ex.

my system variable enviroment on widows is USER_NAME = admin

I want that set spring.datasource.username with USER_NAME

I tryed to do this mode:

in application.properties file spring.datasource.username={USER_NAME}

but dind't set.

anybody knows how to do?

1 Answers1

1

In your application properties the values should be with lower case and separated by point:

spring.datasource.username=${user.name}

Your environment variable should be as you've mentioned:

USER_NAME=admin
Adina Rolea
  • 2,031
  • 1
  • 7
  • 16