Follow Documentation
gpg -K # list your keys
gpg --send-key YOUR_PUBLIC_KEY_ID # publish key
mvn clean
mvn -DskipTests clean deploy
If you are seeing this error while publishing:
gpg: signing failed: Inappropriate ioctl for device
Please run
export GPG_TTY=$(tty)