Just testing out the latest RC and ran into a problem with an existing build. It seems that a change in the MavenPublish code requires that
project.group
is set BEFORE the
publishing {}
block is configured. Otherwise you receive the error:
* What went wrong:
Execution failed for task ':publishPluginPublicationToMavenLocal'.
> Failed to publish publication 'plugin' to repository 'MavenLocal'
> Invalid publication 'plugin': groupId cannot be empty.
Actually, it looks like none of the configuration for the publication works if the publication is declared first. Dependencies do not show up in the POM if they are declared after declaring the publication either.
looks like this didn’t work for PublishToMavenLocal for while (as far back as Gradle 1.9), I think I just never did it before, so never encountered the problem till today.
Declaring the ‘dependsOn’ that way forces a resolve on the publication and the groupId would need to be declared at that point, so this seems like correct behavior. I’m satisfied with that answer.