readmavenpom

This commit is contained in:
VSAzima 2021-04-22 19:00:55 +04:00
parent 737118fb73
commit 6d02d5f0f4

48
Jenkinsfile vendored
View file

@ -27,30 +27,30 @@ pipeline {
stage('push') { stage('push') {
steps { steps {
script { script {
pom = readMavenPom file: "pom.xml"; pom = readMavenPom file: "pom.xml";
filesByGlob = findFiles(glob: "target/*.${pom.packaging}"); filesByGlob = findFiles(glob: "target/*.${pom.packaging}");
echo "${filesByGlob[0].name} ${filesByGlob[0].path} ${filesByGlob[0].directory} ${filesByGlob[0].length} ${filesByGlob[0].lastModified}" echo "${filesByGlob[0].name} ${filesByGlob[0].path} ${filesByGlob[0].directory} ${filesByGlob[0].length} ${filesByGlob[0].lastModified}"
artifactPath = filesByGlob[0].path; artifactPath = filesByGlob[0].path;
artifactExists = fileExists artifactPath; artifactExists = fileExists artifactPath;
if(artifactExists) { if(artifactExists) {
echo "*** File: ${artifactPath}, group: ${pom.groupId}, packaging: ${pom.packaging}, version ${pom.version}"; echo "*** File: ${artifactPath}, group: ${pom.groupId}, packaging: ${pom.packaging}, version ${pom.version}";
nexusArtifactUploader( nexusArtifactUploader(
nexusVersion: NEXUS_VERSION, nexusVersion: NEXUS_VERSION,
protocol: NEXUS_PROTOCOL, protocol: NEXUS_PROTOCOL,
nexusUrl: NEXUS_URL, nexusUrl: NEXUS_URL,
groupId: pom.groupId, groupId: pom.groupId,
version: pom.version, version: pom.version,
repository: NEXUS_REPOSITORY, repository: NEXUS_REPOSITORY,
credentialsId: NEXUS_CREDENTIAL_ID, credentialsId: NEXUS_CREDENTIAL_ID,
artifacts: [ artifacts: [
[artifactId: pom.artifactId, [artifactId: pom.artifactId,
classifier: '', classifier: '',
file: artifactPath, file: artifactPath,
type: pom.packaging], type: pom.packaging],
[artifactId: pom.artifactId, [artifactId: pom.artifactId,
classifier: '', classifier: '',
file: "pom.xml", file: "pom.xml",
type: "pom"] type: "pom"]
] ]
); );
} else { } else {