From 7fb35e03233aec5842fa8a3c3e196776ea331e7f Mon Sep 17 00:00:00 2001 From: Zohar Date: Sun, 7 Apr 2024 19:32:41 -0400 Subject: [PATCH] test2 --- Jenkinsfile-1 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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"