Complete the code to run a Maven build in a Jenkins pipeline.
pipeline {
agent any
stages {
stage('Build') {
steps {
sh 'mvn [1]'
}
}
}
}The compile goal compiles the source code of the project. It is a common first step in Maven builds.
Complete the code to run a Gradle build task in a Jenkins pipeline.
pipeline {
agent any
stages {
stage('Build') {
steps {
sh './gradlew [1]'
}
}
}
}The build task compiles, tests, and assembles the project in Gradle.
Fix the error in the npm build command in this Jenkins pipeline.
pipeline {
agent any
stages {
stage('Build') {
steps {
sh 'npm [1]'
}
}
}
}To run a custom npm script like 'build', you use npm run build. Just 'npm build' is not a valid command.
Fill both blanks to run a Maven clean and package in a Jenkins pipeline.
pipeline {
agent any
stages {
stage('Build') {
steps {
sh 'mvn [1] [2]'
}
}
}
}The clean goal removes previous build files, and package compiles and packages the project.
Fill all three blanks to run a Gradle clean, build, and test in a Jenkins pipeline.
pipeline {
agent any
stages {
stage('Build and Test') {
steps {
sh './gradlew [1] [2] [3]'
}
}
}
}The commands clean, build, and test run cleaning, building, and testing respectively in Gradle.