I've published 5 versions of my repository so far without any issues. With version 1.0.5 I'm getting an error:
Execution failed for task ':publishMavenJavaPublicationToOSSRHRepository'.
> Failed to publish publication 'mavenJava' to repository 'OSSRH'
> No cached resource 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/io/github/jspinak/brobot/1.0.5-SNAPSHOT/maven-metadata.xml' available for offline mode.
The only help I've found online is to toggle the offline mode in Gradle (No Cached Version Gradle Plugin Available for offline mode), which then produces the following error when publishing:
Could not GET 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/io/github/jspinak/brobot/1.0.5-SNAPSHOT/maven-metadata.xml'.
Received status code 400 from server: Bad Request Disable Gradle 'offline mode' and sync project
I'm not sure if this is something I've done wrong, a Sonatype issue, a Gradle issue, an Intellij issue, or something else. I've also posted on the Sonatype message boards just in case.
In the Gradle Toolbar, there is an option generateMetadataFileForMavenJavaPublication. Running this doesn't seem to change anything.
This is an open source repository and you can see the build.gradle file at https://github.com/jspinak/brobot/blob/main/library/build.gradle.