diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..53f37132 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,36 @@ + pipeline { + // agent { node "Slave1" } or agent any + agent any + environment { + // Install the Maven version configured as "maven3.8" and add it to the path. + // tools { maven "maven3"} + // another way of using maven given below. + + PATH="/opt/maven3/bin:$PATH" + } + + stages { + stage('CheckOut') { + steps { + // Get some code from a GitHub repository + git credentialsId: '70860dd4-6c55-45b4-a377-6107adaa15a7', url: 'git@github.com:paramv10/SaiJavaCode.git' + } + } + stage('Build') { + steps { + // Run Maven on a Unix agent. + sh "mvn -Dmaven.test.failure.ignore=true clean package" + // To run Maven on a Windows agent, use + // bat "mvn -Dmaven.test.failure.ignore=true clean package" + } + post { + // If Maven was able to run the tests, even if some of the test + // failed, record the test results and archive the war file. + success { + junit '**/target/surefire-reports/TEST-*.xml' + archiveArtifacts 'webapp/target/*.war' + } + } + } + } + } diff --git a/README.md b/README.md index 8196d201..1968e0b2 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,2 @@ # maven-project - Simple Maven Project diff --git a/webapp/src/main/webapp/index.jsp b/webapp/src/main/webapp/index.jsp index b93fc246..571e592c 100644 --- a/webapp/src/main/webapp/index.jsp +++ b/webapp/src/main/webapp/index.jsp @@ -1,5 +1,42 @@ -