Skip to content

Commit c375d67

Browse files
authored
Update Jenkinsfile
1 parent fbc74b9 commit c375d67

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Jenkinsfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ pipeline {
33
stages {
44
stage('Build on Master') {
55
agent { label 'built-in' }
6-
tools { git 'Default'; maven 'MAVEN' }
6+
tools { maven 'MAVEN' }
77
steps {
8+
// Only build if source is already available; skip checkout on master
89
bat "mvn clean package"
910
stash includes: 'target/*.jar', name: 'myAppJar'
1011
}
@@ -16,6 +17,7 @@ pipeline {
1617
agent { label 'server1' }
1718
tools { git 'LinuxGit' }
1819
steps {
20+
git url: 'https://github.com/pavan203/simple-java-maven-app.git', branch: 'master'
1921
unstash 'myAppJar'
2022
sh "java -cp target/my-app-1.0-SNAPSHOT.jar com.mycompany.app.App"
2123
}
@@ -24,6 +26,7 @@ pipeline {
2426
agent { label 'server2' }
2527
tools { git 'LinuxGit' }
2628
steps {
29+
git url: 'https://github.com/pavan203/simple-java-maven-app.git', branch: 'master'
2730
unstash 'myAppJar'
2831
sh "java -cp target/my-app-1.0-SNAPSHOT.jar com.mycompany.app.App"
2932
}

0 commit comments

Comments
 (0)