diff --git a/Jenkinsfile-1 b/Jenkinsfile-1 index 4173e6f7d..5f5f63832 100644 --- a/Jenkinsfile-1 +++ b/Jenkinsfile-1 @@ -1,20 +1,22 @@ node { + stage('Prepare') { + // Clean workspace + deleteDir() + } stage('SCM') { checkout scm } stage("build"){ sh "./mvnw compile" - sh 'curl -sL https://deb.nodesource.com/setup_14.x | bash -' - sh 'apt-get install -y nodejs' } stage('SonarQube Analysis') { environment{ SCANNER_HOME = tool 'sonar-scanner' - NODEJS_HOME = tool 'nodejs' - PATH = "/path/to/nodejs/bin:$PATH" } + 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"