If Nexus runs in Docker, you update the library location by remapping the volume.
Original run command:
docker run -d -p 8081:8081 --name nexus \
-v nexus-data:/nexus-data sonatype/nexus3
To update the location to a new host directory: update nexus library location
docker stop nexus
docker rm nexus
docker run -d -p 8081:8081 --name nexus \
-v /mnt/new-drive/nexus-libs:/nexus-data sonatype/nexus3
Note: You must manually copy the contents from the old volume (/var/lib/docker/volumes/nexus-data/_data) to the new host path using docker cp or rsync before restarting. If Nexus runs in Docker, you update the
public class Main
public static void main(String[] args)
NexusLibraryLocationUpdater updater = new NexusLibraryLocationUpdater();
updater.updateLibraryLocation("/new/location/nexus-library");
By default, Nexus 3 stores blobs (libraries) inside the sonatype-work directory. To find your current location: To update the location to a new host
find / -type d -name "blobs" 2>/dev/null
Typically: /opt/sonatype-work/nexus3/blobs/
Are you tired of dealing with outdated library locations in your Nexus repository? Do you want to ensure that your project's dependencies are up-to-date and accurate? In this post, we'll walk you through the process of updating the Nexus library location, making it easier to manage your project's dependencies.