private static void dropRepository(
        final URI apiUri,
        final HttpClient httpClient,
        final HttpRequest.Builder requestBuilder,
        final String repositoryKey) throws IOException, InterruptedException
    {
        final HttpRequest request = requestBuilder
            .copy()
            .DELETE()
            .uri(apiUri.resolve("/manual/drop/repository/" + repositoryKey))
            .build();
        final HttpResponse<String> response = httpClient.send(
            request, (ResponseInfo responseInfo) -> BodySubscribers.ofString(US_ASCII));

        if (204 != response.statusCode())
        {
            throw new IllegalStateException("Failed to drop repository: repository_key=" + repositoryKey +
                ", status=" + response.statusCode() + ", response=" + response.body());
        }
    }
Publish staging repository to the Central Portal.
buildSrc/src/main/java/uk/co/real_logic/sbe/build/SonatypeCentralPortalUploadRepositoryTask.java