0
votes

I just migrate our nexus repository to new server and updated build.gradle to point on this server.

uploadArchives {
    repositories.mavenDeployer {
        setUniqueVersion(false)
        repository(url: "http://<tomcat2:8080>/nexus-webapp-1.9.2/content/repositories/releases") {
            authentication(userName: "username", password: "password")
        }
        snapshotRepository(url: "http://<tomcat2:8080>/nexus-webapp-1.9.2/content/repositories/snapshots"){
            authentication(userName: "username", password: "password")
        }
    }
}

Now uploadArchives task fails with error:

Error deploying artifact: Error transferring file Error writing to server

I see 401 error in tomcat2 logs but credential are good. I can login to nexus webapp with these credentials.

User permissions also fine in nexus since it works when I point my nexus url to old server.

I verified nexus username and password also in /.m2/settings.xml.

2

2 Answers

0
votes

Just two possible answers (from own experience):

  • Check if repo's are not defaulted to ReadOnly deployment policy
  • Check your versioning (is your repo a release of snapshot and did you correctly name the version accordingly)
0
votes

Well mvn:deploy works fine on new url. But gradle showing errors.

Downgrading tomcat from 7.0.70 to 7.0.32 (same version as tomcat on old server) fixed the issue with gradle.