In our setting.xml file we have the following:
deploymentRepo repouser<
You can pass the URL including the credentials like
mvn deploy -DaltReleaseDeploymentRepository=myrepo::https://user:pass@server/repo
see https://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html