There is no way to upload a jar and a pom file using the Nexus Platform Plugin if the target repository is a Nexus Repo 2 instance.
Using the following pipeline script will do the right thing for Nexus Repo 3, the mavenCoordinate is ignored and the pom and jar are uploaded using the coordinates from the pom file.
But if Nexus Repo 2 is the target the plugin will first generate a pom using the coordinates, deploy the generated pom and the jar, and also try to deploy the pom file artifact. This results in a failure unless "allow redeploy" is specified in the target repository.
Expected: There needs to be a way to upload a pom file and an artifact to Nexus Repo 2.x using the Nexus Platform plugin.