We are using maven. I want to set up infrastructure, so that automatically built artifacts would go to Nexus repository. And then they could be used by developers.
I
I didn't need to make any changes to my projects pom.xml. Instead, in the jenkins "Post-build Actions" I selected "Deploy artifacts to Maven repository" then selected "Advanced" and set the Repository URL to http://nexusserver:8081/nexus/content/repositories/releases and the Repository ID to deploymentRepo.
In the ~/.m2/settings.xml on the jenkins machine I added
deploymentRepo
deployment
deployment123
...