diff --git a/swan-lake/development-tutorials/ballerina-central/publish-packages-to-ballerina-central.md b/swan-lake/development-tutorials/ballerina-central/publish-packages-to-ballerina-central.md index 99312f4ae50..3d028d66dce 100644 --- a/swan-lake/development-tutorials/ballerina-central/publish-packages-to-ballerina-central.md +++ b/swan-lake/development-tutorials/ballerina-central/publish-packages-to-ballerina-central.md @@ -141,24 +141,38 @@ After publishing your first package, you can create a second package and use the >**Info:** For more information, see [Import a module](/learn/manage-dependencies/#import-a-module). -### Deprecate a published version of a package +## Deprecate packages published in Ballerina Central -If you have released a package version containing a critical bug or security vulnerability, it is possible to deprecate that specific version. +You can deprecate a specific version or all versions of a published package due to name changes, bugs, or security vulnerabilities. -To deprecate a particular version of a package on Ballerina Central, the package owner can run the following command. +### Deprecate all versions of a published package -An optional deprecation message can also be included, which will be displayed to current users of the package. +For example, if you want to change the name of a published package, execute the command below to mark all the versions of the existing package as deprecated and then, publish the package under a new name. + +>**Info:** An optional deprecation message can also be included, which will be displayed to current users of the package. ``` -$ bal deprecate /: --message +$ bal deprecate / --message ``` -A deprecated package version will not appear in package searches on Ballerina Central or the CLI. Additionally, it will not be used for dependency resolution unless it is already a part of a sticky build or no other compatible package version exists. +### Deprecate a specific version of a published package + +For example, if you have released a package version containing a critical bug or security vulnerability, it is possible to deprecate that specific version. -If the deprecated version is in use, a warning message containing the provided deprecation message will be shown during the project build. +To deprecate a particular version of a package on Ballerina Central, the package owner can run the same command with the package version. + +``` +$ bal deprecate /: --message +``` + +>**Info:** If the deprecated package or version is in use, a warning message containing the provided deprecation message will be shown during the project build. +A deprecated package or version will not appear in package searches on Ballerina Central or the CLI. Additionally, it will not be used for dependency +resolution unless it is already a part of a sticky build or no other compatible package version exists. + +### Undo deprecation of a package -To reverse the deprecation of a package, execute the same command with the `--undo` flag. +Execute the command with the `--undo` flag below to reverse the deprecation of a package. ``` -$ bal deprecate /: --undo +$ bal deprecate /[:] --undo ```