Your first step would be to run Gradle with ‘–info --stacktrace’ so you get more details. If that doesn’t help, running with ‘–debug’ will give you a lot more information.
Without more details, it’s pretty hard to tell what’s going wrong. From first glance it looks like you could have the wrong user/password.
Caused by: org.apache.maven.wagon.TransferFailedException: Failed to transfer file: https://artifacts.unidata.ucar.edu/content/repositories/unidata-snapshots/edu/ucar/unidata/sruth/1.0-SNAPSHOT/sruth-1.0-20120628.231243-32.jar. Return code is: 401
at org.apache.maven.wagon.providers.http.LightweightHttpWagon.finishPutTransfer(LightweightHttpWagon.java:205)
I’m afraid it doesn’t shed much light.
I would suspect the username or password except that they were explicitly copied from my settings.xml file and the Maven deployment works. That leaves me with either a bug in LightweightHttpWagon or something wrong with my build.gradle file (which is why I presented it).
I found the problem: I was using Maven’s hash of the password for the Gradle password rather than the password itself, so copying the “password” from the Maven settings.xml file didn’t do what I thought. My mistake.