Maven Central deploy missing javadoc / sources jar in CI
Maven Central rejects a release that does not include a sources jar and a javadoc jar alongside the main artifact. The build must run the source and javadoc plugins so those jars are attached to the deploy.
What this error means
Central validation fails with "Missing: no -sources.jar found" and "Missing: no -javadoc.jar found", or the deploy succeeds but Central refuses to release the staged repository.
[ERROR] Validation failed for com.example:lib:1.0.0
Missing: no -sources.jar found for lib-1.0.0
Missing: no -javadoc.jar found for lib-1.0.0Common causes
The source and javadoc plugins are not configured
Without maven-source-plugin and maven-javadoc-plugin attaching their jars, only the main artifact is deployed and Central rejects the incomplete bundle.
A profile that builds them is not active in CI
Some projects gate the sources/javadoc jars behind a release profile that the CI command did not activate.
How to fix it
Attach the sources and javadoc jars
Bind both plugins so each produces its jar during the package phase and the deploy includes them.
<plugin>
<artifactId>maven-source-plugin</artifactId>
<executions><execution><id>attach-sources</id>
<goals><goal>jar-no-fork</goal></goals></execution></executions>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<executions><execution><id>attach-javadocs</id>
<goals><goal>jar</goal></goals></execution></executions>
</plugin>Activate the release profile in CI
If the jars live behind a profile, pass it explicitly on the deploy command.
mvn -B -Prelease deployHow to prevent it
- Attach -sources.jar and -javadoc.jar for every Central release.
- Activate the release profile in the CI deploy command.
- Validate the staged bundle before releasing to Central.