0

I defined some Environment Variables in ~/.bash_profile,like

export MVN_REPOSITORY_USERNAME=myself
export MVN_REPOSITORY_PASSWORD=myselfPwd

In my SBT plugin configuration project/plugin.sbt I use:

sys.env.get("MVN_REPOSITORY_USERNAME")

If I load my SBT-Project with IntelliJ, they are not set.

However if I start the SBT-Console of IntelliJ, they are set.

Is there any special configuration needed in IntelliJ?

pme
  • 12,997
  • 2
  • 49
  • 80
  • 1
    https://stackoverflow.com/questions/25385934/setting-environment-variables-via-launchd-conf-no-longer-works-in-os-x-yosemite#26586170 might help – Karthikeyan Feb 05 '20 at 11:47
  • You are probably better off storing the values in a dedicated (credentials) file and read that from SBT. – cbley Feb 06 '20 at 14:02

2 Answers2

1

You need to make sure that you source ~/.bash_profile. This is a silly mistake, but an all too common one.

Cody Gray
  • 230,875
  • 49
  • 477
  • 553
  • Thanks, I tried that with no success - meanwhile I have a working solution - see my answer. – pme Jul 30 '20 at 11:55
0

Actually with this SBT Setting it works: intellij-sbt-settings.pngenter image description here

pme
  • 12,997
  • 2
  • 49
  • 80