node{ stage 'checkout' git '[github_url]' def project_path="[project_path]" // everythin in dir block will based on project bath dir(proejct_path) { stage 'compiling, test, packing' sh 'mvn clean package' stage 'archival' step([ $class: 'ArtifcatArchiver', artifacts: "target/*.jar", excludes: null ]) } }
Add 'stage' which we can know what is the progress in a high level way:
'sh' is for any shell commands.
Pipeline is written in Rudy, so can use rudy syntax to def a variable.