Removing an artifact from Maven Central

前端 未结 5 1632
孤独总比滥情好
孤独总比滥情好 2020-12-05 23:23

I just sync\'d an artifact to Maven Central from oss.sonatype.org. Immediately after doing so, a problem was discovered (of course). I haven\'t announced the new artifact

相关标签:
5条回答
  • 2020-12-06 00:01

    If you don't want to create a new version, another solution would be to push the fixed artifact under the same version.

    0 讨论(0)
  • 2020-12-06 00:02

    You can't remove an artifact from Maven Central because others might have used it already. Maven will not check for updates for non-snapshot versions of artifacts, so if someone has used the old version and a new version was uploaded, those people would never see the new version.

    The workaround is to release a new version of your artifact.

    0 讨论(0)
  • 2020-12-06 00:05

    It's hard to resist the urge to just release the staged repository (it's only a click away), but as suggested in the Sonatype OSS Usage Guide

    You will want to download them and do some manual testing (or hold a community vote) before finally releasing them.

    If it's the first time you've released, then you'll have to comment on your OSS Sonatype JIRA ticket to get Central synch activated. Presumably this is an opportunity to say "Wait! This artifact is broken. Please please please don't synch it to Maven Central!" :)

    But as others have said, if it's released then it's too late - you'll have to release a new version (and ensure your users are aware not to use the broken one).

    Beta releases are a good idea for new/major releases - people are a bit more forgiving if you've stuffed something up, and you don't lose your desired version number.

    0 讨论(0)
  • 2020-12-06 00:06

    Can't be done. It's A Rule. But if you want to try, contact the Sonatype people who support oss.sonatype.org. So you generally push a new, higher, version with the fix, and tell everyone to use it.

    0 讨论(0)
  • 2020-12-06 00:12

    If you accidentally distributed an artifact which does not work or has bug or whatever the usual solution in Maven is to create a new version which fixes the problems. That's it. Deleting in Maven Central is not be done and shouldn't ever happen.

    0 讨论(0)
提交回复
热议问题