Gradle upload caught by nexus mirror attempts to upload to public groups instead of snapshot

(Peter Kahn) #1

How to I force gradle to use the appropriate upload URL for my nexus snapshot repo regardless of the mirror setting? Maven handles this fine downloading from mirror group and uploading to snapshot id. Gradle uses the mirror to upload and gets a 400 error.

Please let me know where i’m going wrong.




apply plugin: 'maven'
group = ''
artifactId = 'autobuild'
// from
version = version
  uploadArchives {
    repositories.mavenDeployer {
            repository(id: "snapshots", url:'') {
              authentication(userName: "user", password: "password")
            pom.version = project.version
            pom.artifactId = project.artifactId


      <name>MyCorp Nexus Maven2 Public Group</name>

(Peter Niederwieser) #2

Gradle itself has no concept of “mirror”. Are you saying that ‘gradle uploadArchives’ is trying to use the mirror declared in Maven’s ‘settings.xml’? I’d be surprised if it did.

(dorin.dragan-sassler) #3

Hello Peter,

we have an jenkins server to build artifacts and upload to nexus with maven. I created a jenkins job to build artifacs and upload to nexus with gradle, but I have the same problem. The nexus repository from build.gradle is ignored and the mirror nexus repository from settings.xml is used. I get 400 error.

(Peter Niederwieser) #4

Sounds like a regression. I’ve filed GRADLE-2877.