Thanks everyone, your response was very important, based on the post: “Nexus REST API Upload to Raw repository upload empty files”, I managed to find my error and fix my jenkins pipeline, it is now working correctly.
my pipeline that is working is in the example below, in case someone needs it in the future.
stage('Publish') {
steps {
script{
def binaries = findFiles(glob: '*.exe')
binaries.each { item ->
sh "curl -v -u '${NEXUS_TOKEN}' --upload-file '${item}' '${ENDPOINT}/${RELEASE_ARCH}/'"
}
def metas = findFiles(glob: '**/Updates.xml')
metas.each { item ->
sh "curl -v -u '${NEXUS_TOKEN}' --upload-file '${item}' '${ENDPOINT}/${RELEASE_ARCH}/updates/'"
}
def packages = findFiles(glob: 'updates/br.com.nerd4ever.kue/*.7z')
packages.each { item ->
sh "curl -v -u '${NEXUS_TOKEN}' --upload-file '${item}' '${ENDPOINT}/${RELEASE_ARCH}/updates/br.com.nerd4ever.kue/'"
}
}
}
}
Congratulations!