OSSRH staging rules failure on close in CI
Closing the OSSRH staging repository ran the Central validation rules and one failed. Central requires a valid POM (name, description, url, license, scm, developers), javadoc and sources jars, and signatures. A missing item fails the close.
What this error means
The nexus-staging plugin fails the close step with "Rule failure while trying to close staging repository" and lists the specific requirement, such as missing javadoc or an incomplete POM.
[ERROR] Failed to execute goal org.sonatype.plugins:nexus-staging-maven-plugin:close
[ERROR] Nexus Staging Rules Failure:
[ERROR] - Missing: no javadoc jar found in com/acme/app/1.0.0
[ERROR] - Missing: no signature for app-1.0.0.jarCommon causes
Missing javadoc or sources jars
Central requires -javadoc and -sources jars; if the build did not attach them, the close rule fails.
Incomplete POM metadata
Central requires name, description, url, license, scm, and developers in the POM; any omission fails validation.
How to fix it
Attach javadoc and sources
Bind the source and javadoc plugins so their jars are produced and signed with the release.
mvn -Prelease clean deploy
# release profile runs maven-source-plugin and maven-javadoc-pluginComplete the required POM fields
Add every field Central checks so the staging rules pass.
<name>app</name>
<description>Acme app</description>
<url>https://github.com/acme/app</url>
<licenses>...</licenses>
<scm>...</scm>
<developers>...</developers>How to prevent it
- Keep a release profile that attaches javadoc, sources, and signatures.
- Fill in all Central-required POM metadata once and reuse it.
- Validate the staging repo locally before pushing a release.