publib icon indicating copy to clipboard operation
publib copied to clipboard

Maven publishing abandons staging repositories for existing package versions

Open vinayak-kukreja opened this issue 1 year ago • 1 comments

Maven publishing is creating staging repositories even if the package version being released already exists in Maven. If there are a lot of such concurrent requests, this leads to Maven blocking publishing credentials since this impacts their cleanup process and also customers since it becomes a noisy neighbor issue.

We need to fix our publishing script to check for existing version before starting the publishing process.

Related issue with Maven: https://issues.sonatype.org/browse/OSSRH-94655

vinayak-kukreja avatar Sep 12 '23 15:09 vinayak-kukreja

This command will check if a version exists and respond with the correct shell exit code:

curl --fail -ILs https://oss.sonatype.org/content/repositories/releases/io/github/cdklabs/projen/0.73.9/ > /dev/null

The URL is build as:

${MAVEN_ENDPOINT}/content/repositories/releases/${PACKAGE_URL}/${VERSION}

PACKAGE_URL is the package name as a url, which is any . replaced by /

mrgrain avatar Sep 18 '23 11:09 mrgrain