useradd user with group with same uid and gid
Thanks to Tom Yan, I've ended up solving my issue by creating a group with the same name then added the user to that group. So I did the following:
sudo groupadd -r -g 1234567 nexus \
&& sudo useradd -r -u 1234567 -g 1234567 -m -c "nexus role account" -d /sonatype-work -s /bin/false nexus