Sorry for taking such a long time to reply.
The problem here is, of course, that the project is not open source and I cannot post too much information, so creating a reproducible example is rather difficult here, as is giving exact code samples.
Also not so simple: untangling the plugin code, as it basically is a mashup of several different plugins.
If you (or anyone) can hazard a guess at what might potentially cause this, that would already be a big help.
What I think I can safely show is basically this from the upload-part of the plugin:
project.plugins.apply('maven-publish')
project.configurations { deployerJars }
project.dependencies { deployerJars "org.apache.maven.wagon:wagon-ssh:2.2" }
def canUpload = project.hasProperty(ARTIFACTORY_USERNAME) && project.hasProperty(ARTIFACTORY_PASSWORD)
project.publish.onlyIf({canUpload})
basically this part is defined before the block stated in the original post, followed by an evaluation of canUpload
to define which repository URL is to be sed, which looks similar to this:
if (canUpload) {
repositories {
maven {
def repositoryReleases
def repositorySnapshots
repositoryReleases = ... //ternary to decide on value depending on configured properties
repositorySnapshots = ... // also ternary depending on properties
url = project.version.endsWith('SNAPSHOT') ? repositorySnapshots : repositoryReleases
credentials {
username ...
password ...
}
}
}
}
But I don’t see how this could affect the publish-block before.
Furthermore, the plugin manually defines the filename like this:
project.allprojects.each { current ->
current.afterEvaluate {
def methods = [...]
methods.each { method ->
try {
current."${method}" {
doFirst {
archiveFileName = ...
}
}
}
}
}
}
We also force UTF-8 on all projects with a JavaCompile Type Task, set or replace specific properties via gradle, force source and targetCompatibility to 1.8, and define a formatter task.
These actions are among the list of suspects that I have, as other sub-plugins only define task execution dependencies (like “run tests before calling sonar”) or the like.