I have updated my sample to fix the issue with the content of the POM (artifact name differs from filename).
Basicly you missed the point, that the uploaded artifacts should have a different name.
I have changed the code upload a released version, so you'll see the problem (overwriting uploaded POM is not allowed), when you change the plugin-version to 3.0.0-M1. To make the sample work for you, supply 'releaseRepositoryUrl' and 'releaseRepository' with credentials in your settings.xml