Search code examples
jenkins-pipelinenexus3

Nexus: Getting connection timed out while uploading file into getting


Getting an error which uploading .tgz file into nexus using jenkins pipeline script.

enter image description here

Stage using in my pipeline script as

stage('Upload tar file into nexus') { steps { sh """ curl -f -v $NEXUS --upload-file partnerPortal-* http://localhost:8080/repository/partnerFrontEnd-test/partnerPortal-date +"%d-%m-%Y-%H.%M".tgz """ } }

Note: I'm having jenkins and nexus on the same server. My hosts file is having 127.0.0.1 localhost


Solution

  • After adding -u to the curl command, resolved my issue.

    curl -f -v -u $NEXUS --upload-file customerPortal-* https://localhost:8081/-date +"%d-%m-%Y-%H.%M".tar.gz