This is the only configuration we have for uploadArchives.
uploadArchives {
repositories.mavenDeployer {
configuration = configurations.deployerJars
snapshotRepository(url: "http://OUR_SNAPSHOTS_URL") {
authentication(userName: project.snapshotRepoUserName, password: project.snapshotRepoPassword)
}
repository(url: "http://OUR_RELEASES_URL") {
authentication(userName: project.releaseRepoUserName, password: project.releaseRepoPassword)
}
uniqueVersion = true
}
}
At one time we did have this:
uploadArchives.dependsOn install
But I took that out, and it still puts the archives in the default maven location (USER_HOME/.m2/repository)
Here is the entirety of our build.gradle
apply plugin: 'project-report'
apply plugin: 'release'
project.ext {
defaultSitePublicationLocation = "file://${projectDir}/site"
}
buildscript {
//The following repositories are used only to resolve plugins for the build itself.
repositories {
mavenCentral()
maven {
url 'https://oss.sonatype.org/content/groups/public'
}
maven {
url "http://OUR_SNAPSHOT_URL"
}
maven {
url "http://OUR_RELEASES_URL"
}
}
dependencies {
classpath(
[group: 'org.gradle.api.plugins', name: 'gradle-clover-plugin', version: project.cloverPluginVerison],
[group: 'au.com.ish.gradle', name: 'release', version: project.releasePluginVersion],
)
classpath(group:'org.oclc.gradle', name:'gradle-site-plugin', version: project.sitePluginVersion) {
exclude group: 'xerces', module: 'xercesImpl'
}
}
}
allprojects {
project.ext {
sitePublicationLocation = ''
}
if(project.mavenSiteLocation) {
project.sitePublicationLocation = project.mavenSiteLocation
}
else {
project.sitePublicationLocation = project.defaultSitePublicationLocation
}
apply plugin: 'site'
site {
siteLocation = project.sitePublicationLocation
dependsOnTasks = ['groovydoc', 'javadoc', 'test', 'pmdMain', 'pmdTest', 'findbugsMain', 'findbugsTest']
}
release {
failOnSnapshotDependencies = true
scm = 'svn'
username = project.svnUserName
password = project.svnPassword
}
group = 'org.oclc.instrumentation'
version = release.projectVersion
}
subprojects {
apply plugin: 'java'
apply plugin: 'maven'
sourceCompatibility = new BigDecimal(project.javaVersion as String)
targetCompatibility = new BigDecimal(project.javaVersion as String)
compileJava {
sourceCompatibility = project.javaVersion
targetCompatibility = project.javaVersion
options.fork = true
options.forkOptions.executable = "${project.javaJdkHome}/bin/javac"
options.encoding = "UTF-8"
}
apply plugin: 'checkstyle'
checkstyle {
toolVersion = project.checkstyleVersion
configFile = rootProject.file('config/checkstyle/checkstyle.xml')
configProperties = [
'checkstyle.cache.file': rootProject.file('build/checkstyle.cache'),
]
sourceSets = [sourceSets.main]
}
apply plugin: 'findbugs'
findbugs {
ignoreFailures = false
}
apply plugin: 'pmd'
pmd {
ignoreFailures = false
}
apply plugin: 'clover'
clover {
licenseLocation = "${rootProject.projectDir}/config/clover/clover.license"
targetPercentage = '100%'
report {
xml = true
}
}
configurations {
deployerJars
}
repositories {
mavenCentral()
maven {
url "http://OUR_SNAPSHOT_URL"
}
maven {
url "http://OUR_RELEASES_URL"
}
}
dependencies {
clover([group: "com.cenqua.clover", name: "clover", version: project.cloverVersion])
deployerJars([group: 'org.apache.maven.wagon', name: 'wagon-http', version: project.wagonHttpVersion])
testCompile(
[group: 'junit', name: 'junit', version: project.junitVersion],
[group: 'org.mockito', name: 'mockito-all', version: project.mockitoVersion]
)
}
check.dependsOn cloverGenerateReport
//
install.dependsOn check
//
//
uploadArchives.dependsOn install
uploadArchives {
repositories.mavenDeployer {
configuration = configurations.deployerJars
snapshotRepository(url: "http://OUR_SNAPSHOT_URL") {
authentication(userName: project.snapshotRepoUserName, password: project.snapshotRepoPassword)
}
repository(url: "http://OUR_RELEASES_URL") {
authentication(userName: project.releaseRepoUserName, password: project.releaseRepoPassword)
}
uniqueVersion = true
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
/**
* Allows clients to see where dependencies are being fetched from.
Useful in debugging dependency problems.
*/
task showMeCache << {
configurations.each { config ->
println "${config.name}--------------------------"
config.each { println it }
println "----------------------------------------"
}
}
}
apply plugin: 'idea'
idea.project {
jdkName = project.javaVersion
}
/**
* Allows gradle to packaged as part of the build.
This generates infrastructure files to be committed once.
* Then the build itself will use (or download) the correct version of gradle.
*/
task wrapper(type: Wrapper) {
gradleVersion = project.gradleVersion
}
If you see something wrong in our configuration, I would be happy to change it.
I still think though that I don’t see any reason for org.gradle.api.publication.maven.internal.ant.AbstractMavenResolver to use the EmptyMavenSettingsSupplier, when the MaybeUserMavenSettingsSupplier exists.