Hi,
if you use nexusUser and nexusPassword in build.gradle like that, you can
(ab)use environment variables to inject the credentials from Jenkins to Gradle
as project properties (which you can access the same way as gradle properties).
https://docs.gradle.org/current/userguide/build_environmen
You should make use of the Jenkins credentials store.
https://www.jenkins.io/doc/book/using/using-credentials/
Several kinds of secrets can be stored there. Type "User and password"
suits your needs.
How to use that in your pipeline script:
https://www.jenkins.io/doc/pipeline/steps/credentials-bi