I want to avoid putting this part in pom.xml of every project distributed the same way
<distributionManagement>
<repository>
<id>my-id</id>
<name>My deployed artifacts</name>
<url>https://organization.xxx/maven/</url>
</repository>
</distributionManagement>
How to set it globally via maven command or editing setting file?
Cannot be done in
settings.xml.What you can do:
settings.xmland use it in distributionManagement.-DaltDeploymentRepository=...on command line for the build. See also https://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html#altDeploymentRepository