This project demonstrates setting up a private Nexus repository and publishing Java artifacts using both Gradle and Maven.
Source: Techworld with Nana bootcamp
- Nexus
- DigitalOcean Droplet (Ubuntu)
- Java 17
- Gradle
- Maven
- Linux Shell Scripting
nexus-setup/- Scripts and notes for installing/configuring Nexusgradle-project/- Simple Java project built with Gradle, published to Nexusmaven-project/- Simple Java project built with Maven, published to Nexus
- Ubuntu 24.10
- Opened necessary firewall ports:
- 8081 for Nexus
- 22 for SSH (only from specific IPs for security)
- Installed Nexus using commands listed in (
install-nexus.sh)- Commands were performed manually, although there is opportunity to automate if needed.
- Created a new user with proper permissions
- System user named
nexuswas created for nexus tasks only - More details listed in (
configure-nexus.md)
- System user named
- Used sample repository in Nexus (
maven-snapshots) - Note: This kind of repo is best for capturing builds for lower environments like Development/Test.
-
One project using Gradle
-
One project using Maven
Note: Source files are from previous projects, provided by the author, Nana.
- Configured
build.gradleandpom.xmlto use Nexus as the repository - Built JARs and pushed them using
gradle publishandmvn deploy
- Logged into Nexus web UI
- Verified artifacts appeared in the correct repository
- Credentials are generally configured in
~/[insert_project_directory]/gradle.propertiesand~/.m2/settings.xml(example templates included. see here for gradle and here for maven templates.)
See /screenshots folder for proof of Nexus setup and successful artifact uploads.
- Nexus setup reinforced my knowledge about Linux permissions
- Understood how build tools publish to private artifact repositories
- Gained hands-on experience in setting up internal developer infrastructure