elasticsearch-java
elasticsearch-java copied to clipboard
Sample configuration for singing and publishing to maven central
This is a sample configuration to implement signing and publishing to maven central using a buildkite pipeline.
Note: The script will only work in buildkite. It will work as-it is without any changes there. It's recomended to change use the https://github.com/elastic/vault-secrets-buildkite-plugin in the pipeline instead of the vault cli in the script.
I tested the signing locally and it works, the publishing fails with:
* What went wrong:
Execution failed for task ':java-client-serverless:publishMavenPublicationToMavenCentralSnapshotRepository'.
> Failed to publish publication 'maven' to repository 'MavenCentralSnapshot'
> Could not PUT 'https://s01.oss.sonatype.org/content/repositories/snapshots/co/elastic/clients/elasticsearch-java-serverless/1.0.0-20231031-SNAPSHOT/maven-metadata.xml'. Received status code 401 from server: Unauthorized
But I tested that the credentials are passed correctly. It most likeley fails because not all requirements are ment, see: https://central.sonatype.org/publish/requirements/ You can compare the example pom with yours and lookg at the other requirements. At least the javadoc and source jars are missing.