Solution
I have found a nice workaround. Steps to take:
The build steps have to deploy to a temp folder instead of the normal target repository using the altDeploymentRepository parameter (see http://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html)
mvn deploy -DaltDeploymentRepository=stagingFolder::default::file:///c:/mytempfolder
Run any number of build steps with this setting, and the artifacts are collected in the folder. You can even resume the builds without problem. You can overwrite artifacts (i do not recommend it however)
You have to run the following command after completing all build steps (see http://mojo.codehaus.org/wagon-maven-plugin/copy-mojo.html). This uploads all artifacts which were collected temporarly in the folder:
mvn org.codehaus.mojo:wagon-maven-plugin:copy -Dwagon.source=file:///c:/mytempfolder -Dwagon.target=http://somerepository.com/repositories/snapshots -Dwagon.targetId=idreferredinsettingsxmltogetauthorization
Important Note
The wagon goal should be run in a folder, where there is no pom file (so it must be run without project). Otherwise there is a weird error with the fromDir parameter.
Known Limitations
- The build steps should run using the same local repository, since if the steps need the artifacts produced by other artifacts, they can find it in the local repository.
- This solution does not read the POM to get the repository to which the artifacts should be uploaded. This is wired today into the wagon command. But I can live with it now :)