Unable to publish first snapshot jar to the Sonatype OSS repo

I’m attempting to publish my first jars to the Sonatype OSS snapshot repo. Running ‘gradle publishToMavenLocal’ works perfectly. All the POMs and artifacts are generated properly and have the correct values. Running ‘gradle publish’ fails with the following error:


Running ‘gradle publish --stacktrace’ doesn’t give any more useful information.

Now, the error message is correct - the path to the metadata doesn’t exist: this is the first time I’m creating a snapshot version. I assumed the plugin would detect this and automatically create the path and the first version of maven-metadata.xml. Is this assumption incorrect? Am I doing something wrong with ‘maven-publish’?

I’m not sure about this exact error, but from what I know, the incubating ‘maven-publish’ plugin can’t be used for publishing to Sonatype OSS yet. (For example, it doesn’t support signing yet.) I’m successfully publishing to Sonatype OSS with the “old” ‘maven’ plugin.

Ah. That’s unfortunate. I’ll revert my build scripts to using the ‘maven’ plugin. Thanks Peter.