Install Maven on MacOS
Firstly, fix the “Operation not permitted” issue.
Go to System Preferences -> Privacy -> Full Disk Access -> click the lock to make changes -> provide user credentials -> click on the “+” sign -> select Terminal -> Open
Download and save Maven to an installation directory.
I like to have a folder dedicated to development on my machine.
Open the Terminal.
sudo mkdir /Users/<username>/dev
Download Maven from the official site.
Save the apache-maven-<version>-bin.tar.gz file to /Users/<username>/dev
Extract the archive by either right clicking with your mouse or using Ctrl + Tap with the Trackpad and choose Open from the context menu.
Configure MacOS so that you can use the “mvn” command.
sudo mkdir /usr/local/bin/sudo ln -s /Users/<username>/dev/apache-maven-3.6.3/bin/mvn /usr/local/bin/mvn
Verify it works.