diff --git a/Jenkinsfile b/Jenkinsfile index 2c0b4c87..904820c6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,29 +3,25 @@ pipeline { stages { stage ('Compile Stage') { - steps { - withMaven(maven : 'maven_3_5_0') { - sh 'mvn clean compile' - } + sh 'mvn clean compile' } } stage ('Testing Stage') { - steps { - withMaven(maven : 'maven_3_5_0') { - sh 'mvn test' - } + sh 'mvn test' } } - stage ('Deployment Stage') { + stage ('Package & Save Artifact') { steps { - withMaven(maven : 'maven_3_5_0') { - sh 'mvn deploy' - } + // 1. 'package' builds the .jar file + sh 'mvn clean package' + + // 2. This tells Jenkins to save the .jar file so you can download it from the UI + archiveArtifacts artifacts: 'target/*.jar', fingerprint: true } } } diff --git a/src/main/java/com/techprimers/testing/FizzBuzz.java b/src/main/java/com/techprimers/testing/FizzBuzz.java index 752c0940..65b8a27b 100644 --- a/src/main/java/com/techprimers/testing/FizzBuzz.java +++ b/src/main/java/com/techprimers/testing/FizzBuzz.java @@ -4,6 +4,8 @@ public class FizzBuzz { public String play(int number) { + System.out.print("TEst push 1"); + System.out.print("TEst push 2"); if (number == 0) throw new IllegalArgumentException("Number must not be 0"); if (number % 3 == 0) return "Fizz"; if (number % 5 == 0) return "Buzz";