# Maven Reload with Dynamic Credentails

**URL:** <https://platform.jetbrains.com/t/maven-reload-with-dynamic-credentails/1590>\
**Category:** IntelliJ Platform\
**Created:** [May 3, 2025, 7:45pm UTC](https://platform.jetbrains.com/t/maven-reload-with-dynamic-credentails/1590 "2025-05-03T19:45:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anugrahsinghal](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/anugrahsinghal/32/1287_2.png) [@anugrahsinghal](https://platform.jetbrains.com/u/anugrahsinghal)\
**Post date:** [May 3, 2025, 7:45pm UTC](https://platform.jetbrains.com/t/maven-reload-with-dynamic-credentails/1590/1 "2025-05-03T19:45:27Z")

</div>

Hey everyone,

Dealing with a bit of an annoying issue and hoping someone’s got a clever workaround.

Our Maven repo needs a password via env var and It expires every few hours.

Right now, I’m adding the line `export CUSTOM_PASSWORD=$(my-tool-for-password)` to my `{shell}rc` file and then using `${env.CUSTOM_PASSWORD}` in `settings.xml`.

IntelliJ picks it up fine on startup,but when the password expired, I have to restart the whole IDE 🥺

I took a stab at IntelliJ’s experimental `JarRepositoryAuthenticationDataProvider` (tried to do it like [QodanaSpaceJarRepositoryAuthenticationDataProvider.kt](https://github.com/JetBrains/intellij-plugins/blob/master/qodana/jvm/java/src/org/jetbrains/qodana/jvm/java/jps/QodanaSpaceJarRepositoryAuthenticationDataProvider.kt)), but that also did not work/load.

Also looked at existing plugins that have this need but they just write plain-text password to the settings.xml file which is not the desirable outcome for us https ://plugins.jetbrains.com/plugin/16777-aws-codeartifact–maven.

Even tried a Maven extension [codeartifact-maven-extension](https://github.com/indyaah/codeartifact-maven-extension), but IntelliJ seems to ignore it.

Delegate IDE actions to Maven does not work when doing a maven reload.

So, I’m wondering:

- Anyone else wrestle with auto-expiring Maven passwords in IntelliJ? How did you solve it?
- Is there a way to refresh IntelliJ’s environment variables without a full restart? Any APIs for that?
- Any tips on getting `JarRepositoryAuthenticationDataProvider` to actually work? Maybe I’m missing something obvious.

Any ideas would be hugely appreciated!

I have tested my ideas on IDEA 2024.1 in case that is relavant
