This repository serves as a build wrapper for Sonatype Nexus Repository OSS.
The official Nexus Public Repository has some challenges:
- A separate branch is created for each version (e.g.,
release-3.86.0-08) - The
mainbranch is only sporadically updated (last update: February 2025) - Releases are maintained as separate branches and tags, not as continuous development in the main branch
- The build requires a specific setup (Java 21, Yarn 1.22 & Maven profile "public")
- Build documentation is incomplete and requires knowledge of Maven profiles
This repository automates the build process with GitHub Actions and creates usable artifacts:
- Build artifacts:
.tar.gzand.zipdistributions - Docker images: Automatically built and published to GitHub Container Registry
The fastest way to run Nexus OSS is using the pre-built Docker image:
docker pull ghcr.io/christianhoesel/nexus-public-build:latest
docker run -d -p 8081:8081 -v nexus-data:/nexus-data ghcr.io/christianhoesel/nexus-public-build:latestAccess Nexus at http://localhost:8081
For detailed Docker usage, configuration, and troubleshooting, see DOCKER.md.
- Go to the "Actions" tab in this repository
- Select the workflow "Build Nexus OSS"
- Click on "Run workflow"
- Enter the desired Nexus version (e.g.,
release-3.94.0-12) - Built artifacts can be found under "Artifacts" after the build completes
Find Nexus versions here:
- Branches: https://github.com/sonatype/nexus-public/branches/all
- Releases/Tags: https://github.com/sonatype/nexus-public/releases
Current examples (as of July 2026):
release-3.94.0-12(latest)release-3.93.0-06release-3.89.0-09
Note: Branch names correspond to release tags. Use the branch name for the build.
If you want to build locally:
# Simply use the build script
chmod +x build-local.sh
./build-local.sh release-3.94.0-12The build script automatically performs the following steps:
- Clones the Nexus Public Repository
- Enables Corepack and configures Yarn 4 with
nodeLinker: node-modules - Installs all dependencies with Yarn 4
- Builds all frontend components with
yarn workspaces foreach run build-all - Switches to Yarn 1.22.22 for Maven compatibility
- Runs Maven build with
-Ppublic -Dskip.installyarn -Dskip.yarn -DskipTests - Creates
.tar.gzand.zipdistributions
The finished artifacts can then be found in the Nexus build tree:
nexus-*-unix.tar.gz(~133 MB)nexus-*-unix.zip
After extracting the tarball or zip, you can run Nexus with:
# Extract the archive
tar -xzf nexus-*-unix.tar.gz
cd nexus-*/
# Set environment variables (required)
source bin/nexus-env.sh
# Start Nexus
bin/nexus runThe nexus-env.sh script sets the required INSTALL4J_ADD_VM_PARAMS environment variable with:
- Memory settings (2.7GB heap and direct memory by default)
- Java preferences location
You can also set INSTALL4J_ADD_VM_PARAMS manually if you want to customize memory settings:
export INSTALL4J_ADD_VM_PARAMS="-Xms4g -Xmx4g -XX:MaxDirectMemorySize=4g -Djava.util.prefs.userRoot=${NEXUS_DATA:-./sonatype-work/nexus3}/javaprefs"
bin/nexus run- Java: OpenJDK 21 or 25 (Temurin recommended)
- Node.js: Version 18 or higher
- Corepack: For Yarn 4 (activate with
corepack enable) - Yarn: Version 4.9.1 for frontend build, version 1.22.22 for Maven (automatically managed by build script)
- Maven: Apache Maven 3.9+ (must be installed separately)
- RAM: At least 4 GB for the build process
- Disk: ~2 GB for dependencies and build artifacts
The build uses a two-phase strategy:
Phase 1: Frontend Build with Yarn 4
- Yarn 4.9.1 is activated via Corepack
nodeLinker: node-modulesfor rspack compatibility- Dependencies are installed with
yarn install --no-immutable - Frontend components are built with
yarn workspaces foreach run build-all
Phase 2: Maven Build with Yarn 1
- Switch to Yarn 1.22.22 (via
npm install -g yarn@1.22.22) - Maven build with
-Ppublicprofile - Flags
-Dskip.installyarn -Dskip.yarnskip redundant Yarn steps -DskipTestsspeeds up the build (tests optional)
The GitHub Actions workflow automatically runs builds:
- On Push: To the main branch
- Manual: Via workflow_dispatch with version selection
Weekly automatic builds are currently disabled (can be enabled via cron schedule).
After a successful build, the following artifacts are provided:
nexus-*.tar.gz- Unix/Linux distributionnexus-*.zip- Windows distribution
Artifacts are kept for 30 days.
Docker images are automatically built and published to the GitHub Container Registry:
- Registry:
ghcr.io/christianhoesel/nexus-public-build - Tags:
latest- Latest build from main branch<version>- Specific Nexus version (e.g.,3.94.0-12)<branch>-<sha>- Branch-specific builds
# Pull latest version
docker pull ghcr.io/christianhoesel/nexus-public-build:latest
# Pull specific version
docker pull ghcr.io/christianhoesel/nexus-public-build:<version>See DOCKER.md for complete Docker usage documentation.
The Maven profile -Ppublic is required for the OSS build. It activates the necessary modules and configurations for the public version of Nexus Repository.
Nexus Repository OSS is licensed under the Eclipse Public License. This build repository is MIT licensed.