Refactor maven buildSettings to work with any post build step
Reproduce JENKINS-20209 and JENKINS-21045