mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-21 15:25:49 +00:00
add build jar
This commit is contained in:
parent
1804721e1d
commit
35bb2eaf96
1 changed files with 89 additions and 32 deletions
121
Jenkinsfile-1
121
Jenkinsfile-1
|
@ -1,34 +1,91 @@
|
||||||
node {
|
// pipeline {
|
||||||
stage('Prepare') {
|
// agent any
|
||||||
// Clean workspace
|
// stages{
|
||||||
deleteDir()
|
|
||||||
}
|
|
||||||
stage('SCM') {
|
|
||||||
checkout scm
|
|
||||||
}
|
|
||||||
stage("build"){
|
|
||||||
sh "./mvnw compile"
|
|
||||||
|
|
||||||
}
|
|
||||||
stage('SonarQube Analysis') {
|
// stage('Prepare') {
|
||||||
environment{
|
// // Clean workspace
|
||||||
SCANNER_HOME = tool 'sonar-scanner'
|
// deleteDir()
|
||||||
|
// }
|
||||||
|
// stage('SCM') {
|
||||||
|
// checkout scm
|
||||||
|
// }
|
||||||
|
// stage("build"){
|
||||||
|
// sh "./mvnw compile"
|
||||||
|
|
||||||
|
// }
|
||||||
|
// stage('SonarQube Analysis') {
|
||||||
|
// environment{
|
||||||
|
// SCANNER_HOME = tool 'sonar-scanner'
|
||||||
|
// }
|
||||||
|
// env.NODEJS_HOME = "${tool 'nodejs'}"
|
||||||
|
// env.PATH = "${env.NODEJS_HOME}/bin:${env.PATH}"
|
||||||
|
// def mvn = tool 'M3';
|
||||||
|
// withSonarQubeEnv("sq1") {
|
||||||
|
// sh "${mvn}/bin/mvn sonar:sonar -Dsonar.projectKey=Web -Dsonar.projectName='Web' -Dsonar.sources=src/ -Dsonar.java.binaries=target/classes/ -Dsonar.exclusions=src/test/java/****/*.java"
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// stage("Build JAR"){
|
||||||
|
// steps{
|
||||||
|
// sh "./mvnw package"
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
// post{
|
||||||
|
// success{
|
||||||
|
// archiveArtifacts "target/*.jar"
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
pipeline {
|
||||||
|
agent any
|
||||||
|
|
||||||
|
stages {
|
||||||
|
stage('Prepare') {
|
||||||
|
steps {
|
||||||
|
// Clean workspace
|
||||||
|
deleteDir()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('SCM') {
|
||||||
|
steps {
|
||||||
|
checkout scm
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Build') {
|
||||||
|
steps {
|
||||||
|
sh './mvnw compile'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('SonarQube Analysis') {
|
||||||
|
environment {
|
||||||
|
SCANNER_HOME = tool 'sonar-scanner'
|
||||||
|
NODEJS_HOME = "${tool 'nodejs'}"
|
||||||
|
PATH = "${env.NODEJS_HOME}/bin:${env.PATH}"
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
def mvn = tool 'M3'
|
||||||
|
withSonarQubeEnv('sq1') {
|
||||||
|
sh "${mvn}/bin/mvn sonar:sonar -Dsonar.projectKey=Web -Dsonar.projectName='Web' -Dsonar.sources=src/ -Dsonar.java.binaries=target/classes/ -Dsonar.exclusions=src/test/java/****/*.java"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Build JAR') {
|
||||||
|
steps {
|
||||||
|
sh './mvnw package'
|
||||||
|
}
|
||||||
|
post {
|
||||||
|
success {
|
||||||
|
archiveArtifacts 'target/*.jar'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
env.NODEJS_HOME = "${tool 'nodejs'}"
|
}
|
||||||
env.PATH = "${env.NODEJS_HOME}/bin:${env.PATH}"
|
|
||||||
def mvn = tool 'M3';
|
|
||||||
withSonarQubeEnv("sq1") {
|
|
||||||
sh "${mvn}/bin/mvn sonar:sonar -Dsonar.projectKey=Web -Dsonar.projectName='Web' -Dsonar.sources=src/ -Dsonar.java.binaries=target/classes/ -Dsonar.exclusions=src/test/java/****/*.java"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage("Build JAR"){
|
|
||||||
steps{
|
|
||||||
sh "./mvnw package"
|
|
||||||
}
|
|
||||||
post{
|
|
||||||
success{
|
|
||||||
archiveArtifacts "target/*.jar"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue