publishToMavenLocal is always UP-TO-DATE

I’m moving a project to java 17 and gradle 7.3.3. I use this project in another project so I need this project (jpsgcs) in my .m2 repo.

I have included the maven-publish plugin but I never get a pom. Far as I can tell the publish never happens because > Task :publishToMavenLocal UP-TO-DATE always shows up in the console output even after a clean rebuild of the entire project (including a rm -rf ./build)

A scan is at Build Scan™ | Gradle Cloud Services

Any help much appreciated.

Did you declare the publication? The behavior described is typically what happens when the plugin is applied without configuring the publication. The task :publishToMavenLocal doesn’t do the actual work, but it will depend on the publication-specific tasks that are created once you do that. i.e. if the publication is just called maven:

> Task :generateMetadataFileForMavenPublication
> Task :generatePomFileForMavenPublication
> Task :publishMavenPublicationToMavenLocal
> Task :publishToMavenLocal

thank you. You’re right of course. I had my “publishing{}” at the wrong level. I had to put it inside allprojects{} and now my .m2 has the lastest. I don’t understand this subtlety at all, but that’s my usual stance vis gradle.
Thank you, again.