I have a bulk full of projects which have the same URLs in their pom.xml:
https://github.com/malkusch/${project.artifactId}
Adding to the already great background information given, in order to still deploy with a valid scm url, since Maven 3.5 you can correct the "module" name that gets appended per the project.directory property:
${project.artifactId}
And then you just simplify your developerConnection to not include the artifactId anymore since it will be appended as the project.directory:
scm:git:git@server:
Assuming this doesn't conflict with any other goals, that should allow a deploy goal to do its job with the correct git url for a non-multi-module Maven project where you've defined the scm.developerConnection in the parent pom.
When I run a deploy, I see maven doing a correct push like:
[INFO] Executing: /bin/sh -c cd /projectDir/proj && git push git@server:proj master:master