Hallo All,
since we have upgraded from gradle4 to the current version we have a changed behavior for the evaluation of publishing.publications, because there are changes in gradle >5.0
https://docs.gradle.org/current/userguide/publishing_maven.html#publishing_maven:deferred_configuration
But how do you get the code to run like it did before
The publishing array during the init-phase:
rootProject {
allprojects {
afterEvaluate { project ->
if (project.plugins.hasPlugin("maven-publish")) {
def publicationNames = project.publishing.publications.collect { it.name }.toArray()
println("During: Init-Phase: ${project}:${publicationNames}")
}
}
}
}
produces:
[pluginMaven]
the same code, later in the root projects build.gradle produces:
[myPluginPluginMarkerMaven, pluginMaven]
which I had also expected in the previous phase and which was the behavior with gradle 4.10.3
How to fix this?
Kind regards,
Tom