diff --git a/vars/findVersionFromNexusRepo.groovy b/vars/findVersionFromNexusRepo.groovy index d7a06b7..b81f2b6 100644 --- a/vars/findVersionFromNexusRepo.groovy +++ b/vars/findVersionFromNexusRepo.groovy @@ -45,7 +45,7 @@ Map call(Map config = [:], Map queryParams = [:]) { /* groovylint-disable-next-line Instanceof */ if (latest.version instanceof net.sf.json.JSONNull && latest.name) { echo 'Info: Search result version field was null, looking in name field for a version' - java.util.regex.Matcher match = (latest.name =~ /(?<=-)(\d+\.\d+\.\d+)(?=[\.-].*)/) + java.util.regex.Matcher match = (latest.name =~ /(?<=-)(\d+\.\d+\.\d+)(?=[\.].*)/) if (!match) { echo "Error: Match: ${match}" error("Regular expression match failed for latest.name: ${latest.name}") diff --git a/vars/packageStage.groovy b/vars/packageStage.groovy index ec248f9..22e136a 100644 --- a/vars/packageStage.groovy +++ b/vars/packageStage.groovy @@ -22,7 +22,7 @@ String call(Map config = [:], Closure body = { }) { archiveName = runConfig.name + runConfig.separator + (runConfig.useHash ? runConfig.hash : runConfig.version) + - runConfig.separator + + '.' + runConfig.extension echo "Info: Will archive results as: ${archiveName}." diff --git a/vars/publishToNexus.groovy b/vars/publishToNexus.groovy index 492a7c2..029f231 100644 --- a/vars/publishToNexus.groovy +++ b/vars/publishToNexus.groovy @@ -1,16 +1,18 @@ void call(Map config = [:], String packageName) { - publishURL = [ config.nexusBase, config.nexusRepository, config.nexusRepoPath, packageName ].join('/') + publishURL = [ config.nexusBase, 'repository', config.nexusRepository, config.nexusRepoPath, packageName ].join('/') echo 'Info: Publishing...' echo "Info: ${publishURL}" - response = httpRequest httpMode: 'POST', - authenticate: 'publisher', + response = httpRequest authentication: 'publisher', consoleLogResponseBody: true, - contentType: ' APPLICATION_FORM_DATA', + contentType: 'APPLICATION_FORM_DATA', url: publishURL, wrapAsMultipart: true, - requestBody: [$class: 'FileRequestBody', file: packageName] + httpMode: 'PUT', + validResponseCodes: '201', + multipartName: "${packageName}", + uploadFile: packageName echo "Response: ${response.content}" }