mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-25 00:25:50 +00:00
readmavenpom
This commit is contained in:
parent
737118fb73
commit
6d02d5f0f4
1 changed files with 24 additions and 24 deletions
48
Jenkinsfile
vendored
48
Jenkinsfile
vendored
|
@ -27,30 +27,30 @@ pipeline {
|
|||
stage('push') {
|
||||
steps {
|
||||
script {
|
||||
pom = readMavenPom file: "pom.xml";
|
||||
filesByGlob = findFiles(glob: "target/*.${pom.packaging}");
|
||||
echo "${filesByGlob[0].name} ${filesByGlob[0].path} ${filesByGlob[0].directory} ${filesByGlob[0].length} ${filesByGlob[0].lastModified}"
|
||||
artifactPath = filesByGlob[0].path;
|
||||
artifactExists = fileExists artifactPath;
|
||||
if(artifactExists) {
|
||||
echo "*** File: ${artifactPath}, group: ${pom.groupId}, packaging: ${pom.packaging}, version ${pom.version}";
|
||||
nexusArtifactUploader(
|
||||
nexusVersion: NEXUS_VERSION,
|
||||
protocol: NEXUS_PROTOCOL,
|
||||
nexusUrl: NEXUS_URL,
|
||||
groupId: pom.groupId,
|
||||
version: pom.version,
|
||||
repository: NEXUS_REPOSITORY,
|
||||
credentialsId: NEXUS_CREDENTIAL_ID,
|
||||
artifacts: [
|
||||
[artifactId: pom.artifactId,
|
||||
classifier: '',
|
||||
file: artifactPath,
|
||||
type: pom.packaging],
|
||||
[artifactId: pom.artifactId,
|
||||
classifier: '',
|
||||
file: "pom.xml",
|
||||
type: "pom"]
|
||||
pom = readMavenPom file: "pom.xml";
|
||||
filesByGlob = findFiles(glob: "target/*.${pom.packaging}");
|
||||
echo "${filesByGlob[0].name} ${filesByGlob[0].path} ${filesByGlob[0].directory} ${filesByGlob[0].length} ${filesByGlob[0].lastModified}"
|
||||
artifactPath = filesByGlob[0].path;
|
||||
artifactExists = fileExists artifactPath;
|
||||
if(artifactExists) {
|
||||
echo "*** File: ${artifactPath}, group: ${pom.groupId}, packaging: ${pom.packaging}, version ${pom.version}";
|
||||
nexusArtifactUploader(
|
||||
nexusVersion: NEXUS_VERSION,
|
||||
protocol: NEXUS_PROTOCOL,
|
||||
nexusUrl: NEXUS_URL,
|
||||
groupId: pom.groupId,
|
||||
version: pom.version,
|
||||
repository: NEXUS_REPOSITORY,
|
||||
credentialsId: NEXUS_CREDENTIAL_ID,
|
||||
artifacts: [
|
||||
[artifactId: pom.artifactId,
|
||||
classifier: '',
|
||||
file: artifactPath,
|
||||
type: pom.packaging],
|
||||
[artifactId: pom.artifactId,
|
||||
classifier: '',
|
||||
file: "pom.xml",
|
||||
type: "pom"]
|
||||
]
|
||||
);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue