Store credentials for gradle in gnome-keyring

Credentials for artifactory, nexus or the like are usually stored in ~/.gradle/gradle.properties. But what if you don't want to store passwords in plaintext or you need to change them frequently? Instead wouldn't it be nicer to use a system keyring that manages the passwords and keeps them encrypted?