Compiling and Running Nexus Source Code and Understanding Its Local Storage
This article explains how to download, configure, and compile the Nexus repository manager from source, then details the structure and strategy of its local storage directories, providing insights into its blob, cache, database, and other components.
Reading font
The previous article introduced Nexus's main features and briefly described its source code; this follow‑up shows how to compile and run the Nexus source, and dives into the design of its local storage.
First, download the latest Nexus code from GitHub (e.g., release‑3.8.0‑02) and add the Nexus repository to your Maven settings.xml because Nexus is a complex Maven project that otherwise lacks required libraries.
Then build the project with ./mvnw clean install -DskipTests. The initial build may take 1–2 hours to fetch dependencies and run tests, while subsequent builds only need a few minutes. After building, unzip the generated nexus-base-template-3.8.0-02.zip and deploy it.
The article then explains Nexus's local storage layout under the data directory:
blobs – stores component and asset files as *.bytes and *.properties.
cache – holds cached Karaf bundle information.
db – contains OrientDB data such as analytics, components, security, audit, config, and access logs.
elasticsearch – configuration for the embedded Elasticsearch engine.
etc – runtime and custom Nexus configuration files.
log – Nexus log files.
Key bundles involved in storage are nexus-blobstore-api, nexus-blobstore, and nexus-blobstore-file, which manage blob operations, directory strategies, and lifecycle handling.
In summary, Nexus uses Karaf as an OSGi container to integrate many bundles and a plugin system for advanced features; its storage size depends on the server’s disk capacity, and future optimization may move components and assets to S3 for greater scalability and reliability.
For questions about attribution, corrections or content rights, please contactand we will review it promptly.