0

this is an issue that started very recently. In my root level bash profile i have these env variables set

export ARTIFACTORY_USER="...."
export ARTIFACTORY_API_TOKEN="....."

I have a maven IntelliJ project Settings.xml file that references these variables like this...

        <server>
            <id>releases</id>
            <username>${env.ARTIFACTORY_USER}</username>
            <password>${env.ARTIFACTORY_API_TOKEN}</password>
        </server>

The problem is, when I first open IntelliJ or create a new terminal window, if i run echo $ARTIFACTORY_USER then it doesn't print anything. If i run source ~/.bash_profile, then it prints the correct value. Despite what I do though, if i run mvn clean package or try to reload the maven files from the maven sidebar, it doesn't seem to pull in this system env variables. I haven't changed any of my IDE settings in a long time so i'm not sure why this is happening all of a sudden. It's been working this way for years. If i look at the effective POM then it doesn't show the correct values either. What could be the issue here?

I've tried manually adding these values to the project POM.xml properties, or adding the hard coded value to the Settings.xml, but neither work.

DCHalo
  • 11
  • 1
  • See https://stackoverflow.com/a/26586170/104891 for the proper way to set environment variables so that not only apps started from the terminal can access them. – CrazyCoder Mar 02 '23 at 21:28
  • Why using env variables for accessing a repository manager... ? second which maven version do you use? – khmarbaise Mar 03 '23 at 15:35

0 Answers0