How to set up a Maven private repository: from install to settings.xml, HOSTED, PROXY, and GROUP

After self-hosting, wire Maven: create HOSTED/PROXY/GROUP, configure settings.xml and pom.xml, run resolve and deploy, and fix 401/409.