publib
publib copied to clipboard
Maven publishing abandons staging repositories for existing package versions
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
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 /