I am trying to upload the artifact to Nexus repository using the Artifact deployment stage in the Jenkins pipeline. For doing this I am providing Jenkins with the Nexus credentials and the path to find the repository. But, this stage is failed with an error "the connection is refused to nexus".
However, I am able to access Nexus on http://localhost:8081/nexus.
Below is the code used in pipeline_config.yml file.
artifactDeployment:
nexus:
version: nexus2
url: 'http://localhost:8081/nexus/'
repository: myrepo
credentialsId: 'nexus'
additionalClassifiers:
- type: jar
classifier: classes
Could someone please suggest in resolving this issue?