Gradle 7.1 fails to download artifacts

Gradle 7.1 fails to download artifact from artifactory. I have tried the below with Gradle 6.5.1, 6.7.1 and same error. Any idea what could be the issue?


Failed to get resource: GET. [HTTP HTTP/1.1 401 Unauthorized:]


repositories {
maven {
url “
credentials {
username = “name”
password = “pass”

Kind Regards,

If that is really what you used, you used name and pass literally and with that the authentication fails of course.

Thanks for the quick reply. I am new to the programming and Gradle. Could you let me know what change I would need to fix this issue? Appreciate your help in advance.

Remove the quotes around them.
You don’t want Strings, you want the values of the properties.

Or you have to use it as “$name” or “${name}” and “$pass” or “${pass}”, so gradle resolve the variable value in the string.

Thanks for the reply. I have used “${name}” syntax however it is failing with the following error:

C:\Projects\samplegradle>gradle build
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
Could not write standard input to Gradle Test Executor 1. The pipe is being closed
at Method)
at org.gradle.process.internal.streams.ExecOutputHandleRunner.forwardContent(
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(
at org.gradle.internal.concurrent.ManagedExecutorImpl$
at java.util.concurrent.ThreadPoolExecutor.runWorker(
at java.util.concurrent.ThreadPoolExecutor$
at org.gradle.internal.concurrent.ThreadFactoryImpl$

Task :test FAILED
Error occurred during initialization of VM
java.lang.InternalError: Could not create SecurityManager:
at sun.misc.Launcher.(
at sun.misc.Launcher.(
at java.lang.ClassLoader.initSystemClassLoader(
at java.lang.ClassLoader.getSystemClassLoader(

Hard to guess without seeing your build scripts, but does not sound related to your initial question