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.
Thanks
Peter
build.gradle
apply plugin: 'maven'
group = 'my.group'
artifactId = 'autobuild'
// from gradle.properties
version = version
uploadArchives {
repositories.mavenDeployer {
repository(id: "snapshots", url:'http://my.internal.nexus/nexus/content/repositories/snapshots') {
authentication(userName: "user", password: "password")
}
pom.version = project.version
pom.artifactId = project.artifactId
}
settings.xml
<mirrors>
<mirror>
<id>internal-repository</id>
<name>MyCorp Nexus Maven2 Public Group</name>
<url>http://my.internal.nexus/nexus/content/groups/public</url>
<mirrorOf>*</mirrorOf>
</mirror>
</mirrors>
<profiles>
<profile>
<id>default-profile</id>
<repositories>
<repository>
<id>releases</id>
<url>http://my.internal.nexus/nexus/content/repositories/releases</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>snapshots</id>
<url>http://my.internal.nexus/nexus/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
</repository>