void call(Map config = [:], String packageName) { publishURL = [ config.nexusBase, config.nexusRepository, config.nexusRepoPath, packageName ].join('/') echo "Info: ${publishURL}" withCredentials([usernameColonPassword(credentialsId: 'publisher', variable: 'NEXUS_PUBLISH')]) { response = httpRequest httpMode: 'POST', contentType: 'multipart/form-data', url: publishURL, wrapAsMultipart: true, customHeaders: [ [name: 'Authorization', value: 'Basic ' + "${env.NEXUS_PUBLISH}".bytes.encodeBase64()] ], requestBody: [$class: 'FileRequestBody', file: packageName] echo "Response: ${response.content}" } }