From ef1fca9267931beab44b26dfbb6e8fdac7544d31 Mon Sep 17 00:00:00 2001 From: sandeepds Date: Fri, 23 Aug 2019 19:41:18 +0530 Subject: [PATCH] Create jenkinsfile Create Sample Jenkins File --- jenkinsfile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 jenkinsfile diff --git a/jenkinsfile b/jenkinsfile new file mode 100644 index 000000000..3ebca48ba --- /dev/null +++ b/jenkinsfile @@ -0,0 +1,25 @@ +node { + def mvnHome + stage('Preparation') { // for display purposes + // Get some code from a GitHub repository + git 'https://github.com/jglick/simple-maven-project-with-tests.git' + // Get the Maven tool. + // ** NOTE: This 'M3' Maven tool must be configured + // ** in the global configuration. + mvnHome = tool 'M3' + } + stage('Build') { + // Run the maven build + withEnv(["MVN_HOME=$mvnHome"]) { + if (isUnix()) { + sh '"$MVN_HOME/bin/mvn" -Dmaven.test.failure.ignore clean package' + } else { + bat(/"%MVN_HOME%\bin\mvn" -Dmaven.test.failure.ignore clean package/) + } + } + } + stage('Results') { + junit '**/target/surefire-reports/TEST-*.xml' + archiveArtifacts 'target/*.jar' + } +}