- Write a RESTful API with Ballerina
- Write a gRPC service with Ballerina
- Write a GraphQL API with Ballerina
- Work with data using queries in Ballerina
- Build a data service in Ballerina
- Build a Change Data Capture (CDC) service in Ballerina
- Work with Large Language Models (LLMs) using natural expressions
- Deploy Ballerina on Kubernetes
- Manage data persistence with bal persist
- Create your first connector with Ballerina
- Write a workflow with Ballerina
- Write a workflow with a human task
- Handle errors and replay failed activities in workflows
Set up Sonatype Nexus as a private repository to host your own Ballerina packages, or as a caching proxy for Ballerina Central.
Set up a private repository
To host your own private Ballerina packages, create a standard Maven-type (hosted) repository following the Nexus documentation.
Configure and use the repository
Define the repository in the <USER_HOME>/.ballerina/Settings.toml file, using the URL you copied above.
[[repository.maven]] id = "nexus_1" # This ID is used when pushing/pulling packages url = "<repository-url>" username = "<username>" accesstoken = "<password>"
Generate the Ballerina archive and publish it to the repository.
$ bal pack $ bal push --repository nexus_1
For more information on defining custom repositories, publishing packages, and using a published package as a dependency, see Use custom repositories for package management.
Configure a proxy repository
Follow the steps below to configure a Maven proxy repository in Sonatype Nexus that points to Ballerina Central.
-
Log in to your Nexus Repository Manager as an administrator.
-
Navigate to Settings → Repository → Repositories and click Create repository.
-
Select maven2 (proxy) as the recipe.
-
Fill in the repository details.
Field Value Name A unique name for the repository (e.g., ballerina-central-proxy)Remote storage https://api.central.ballerina.io/2.0/maven -
Under the Maven 2 section, ensure Strict Content Type Validation is disabled (unchecked). Ballerina Central serves
.balapackage artifacts alongside customized Maven metadata, and enabling strict content type validation will cause downloads to fail for non-standard MIME types. -
Under the Proxy section, set Maximum metadata age to a low value such as
1minute. This ensures that newly published packages in Ballerina Central are discovered promptly without waiting for a long metadata cache expiry.Note: Setting Maximum metadata age to
0forces Nexus to re-fetch metadata on every request, which may increase latency. A value between1and5minutes is a good balance between freshness and performance. -
Click Create repository to save the configuration.
-
Copy the repository URL displayed on the repository list page. You will use it when configuring the Ballerina client to use the proxy.