From 3b72c450cc72a13a846c806956224fd612f20457 Mon Sep 17 00:00:00 2001 From: sylvain-combe-sonarsource Date: Thu, 30 Jan 2020 15:34:03 +0100 Subject: [PATCH 01/46] add quality issues to code branch --- my-app.iml | 16 +++++++++++++++ src/main/java/com/mycompany/app/App.java | 25 +++++++++++++++++++++--- 2 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 my-app.iml diff --git a/my-app.iml b/my-app.iml new file mode 100644 index 0000000000..e802c7b850 --- /dev/null +++ b/my-app.iml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/mycompany/app/App.java b/src/main/java/com/mycompany/app/App.java index 5a6d57214d..cfddd83e7f 100644 --- a/src/main/java/com/mycompany/app/App.java +++ b/src/main/java/com/mycompany/app/App.java @@ -7,15 +7,34 @@ public class App { private final String message = "Hello World!"; + public String msg1; + public String msg2; - public App() {} + + public App() { + msg1 = "one"; + msg2="two"; + } public static void main(String[] args) { - System.out.println(new App().getMessage()); + App myApp = new App(); + try { + System.out.println(myApp.getMessage()); + } catch (InterruptedException e) { + e.printStackTrace(); + } } - private final String getMessage() { + private final String getMessage() throws InterruptedException { + synchronized (this.msg1) { + // threadB can't enter this block to request this.mon2 lock & release threadA + synchronized (this.msg2) { + this.msg2.wait(); // Noncompliant; threadA is stuck here holding lock on this.mon1 + } + } + return message; } + } From 79717703c5d604ff5d324e4b9793fac2a5b7bc4d Mon Sep 17 00:00:00 2001 From: sylvain-combe-sonarsource Date: Thu, 30 Jan 2020 17:11:36 +0100 Subject: [PATCH 02/46] add branch name to pipeline mvn cmd --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 83d667223c..1dac6c7b02 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,7 +11,7 @@ pipeline { stage('Build') { steps { withSonarQubeEnv(installationName: 'ngrok syco') { - sh 'mvn -X -B -DskipTests clean package sonar:sonar' + sh 'mvn -X -B -Dsonar.branch.name=$GIT_BRANCH -DskipTests clean package sonar:sonar' } } } From c920aec0163b96873d32f7b3a28c93ada811b369 Mon Sep 17 00:00:00 2001 From: sylvain-combe-sonarsource Date: Thu, 30 Jan 2020 17:58:15 +0100 Subject: [PATCH 03/46] master branch condition in JenkinsFile --- Jenkinsfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1dac6c7b02..d6cec1a2b0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,7 +11,10 @@ pipeline { stage('Build') { steps { withSonarQubeEnv(installationName: 'ngrok syco') { - sh 'mvn -X -B -Dsonar.branch.name=$GIT_BRANCH -DskipTests clean package sonar:sonar' + if($GIT_BRANCH == "master") + sh 'mvn -X -B -DskipTests clean package sonar:sonar' + else + sh 'mvn -X -B -Dsonar.branch.name=$GIT_BRANCH -DskipTests clean package sonar:sonar' } } } From 88dfc0668b69fc3a29c490f284f71a6f95637d0d Mon Sep 17 00:00:00 2001 From: sylvain-combe-sonarsource Date: Fri, 31 Jan 2020 12:08:23 +0100 Subject: [PATCH 04/46] report JenkinsFile fix done on master --- Jenkinsfile | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d6cec1a2b0..b8f5613927 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,3 +1,9 @@ +if (env.BRANCH_NAME == 'master') + mybranch = '' +else + mybranch = env.BRANCH_NAME + + pipeline { agent { docker { @@ -10,12 +16,9 @@ pipeline { stages { stage('Build') { steps { - withSonarQubeEnv(installationName: 'ngrok syco') { - if($GIT_BRANCH == "master") - sh 'mvn -X -B -DskipTests clean package sonar:sonar' - else - sh 'mvn -X -B -Dsonar.branch.name=$GIT_BRANCH -DskipTests clean package sonar:sonar' - } + withSonarQubeEnv(installationName: 'ngrok syco') { + sh 'mvn -X -B -Dsonar.branch.name=${mybranch} -DskipTests clean package sonar:sonar' + } } } stage('Test') { From b35b56e11150ea25fda86b28cc4620963d07e8ab Mon Sep 17 00:00:00 2001 From: sylvain-combe-sonarsource Date: Tue, 4 Feb 2020 10:13:37 +0100 Subject: [PATCH 05/46] fixed locked unitary tests --- src/main/java/com/mycompany/app/App.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/mycompany/app/App.java b/src/main/java/com/mycompany/app/App.java index cfddd83e7f..a79fe4567b 100644 --- a/src/main/java/com/mycompany/app/App.java +++ b/src/main/java/com/mycompany/app/App.java @@ -25,14 +25,17 @@ public static void main(String[] args) { } } - private final String getMessage() throws InterruptedException { + private final String getMessage(boolean isSync) throws InterruptedException { synchronized (this.msg1) { // threadB can't enter this block to request this.mon2 lock & release threadA synchronized (this.msg2) { this.msg2.wait(); // Noncompliant; threadA is stuck here holding lock on this.mon1 } } + return message; + } + private final String getMessage() throws InterruptedException { return message; } From ebdcd17889fb66eb3009041fa44c4cc3d98681fc Mon Sep 17 00:00:00 2001 From: sylvain-combe-sonarsource Date: Tue, 4 Feb 2020 13:57:45 +0100 Subject: [PATCH 06/46] try to dump JenkinsFile env --- Jenkinsfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index b8f5613927..31629384a3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,6 +3,9 @@ if (env.BRANCH_NAME == 'master') else mybranch = env.BRANCH_NAME +node { + echo "$env" +} pipeline { agent { From 30eba7de6e7b3a16c919602a953dc73749e1fd44 Mon Sep 17 00:00:00 2001 From: sylvain-combe-sonarsource Date: Tue, 4 Feb 2020 14:09:13 +0100 Subject: [PATCH 07/46] try to dump JenkinsFile env 2 --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 31629384a3..876241f914 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,7 +4,8 @@ else mybranch = env.BRANCH_NAME node { - echo "$env" + echo "hello here" + env.dump() } pipeline { From 25a0ec1a991840bb5c3042b5ade7a0fca59b811b Mon Sep 17 00:00:00 2001 From: sylvain-combe-sonarsource Date: Tue, 4 Feb 2020 14:30:57 +0100 Subject: [PATCH 08/46] try to dump JenkinsFile env 3 --- Jenkinsfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 876241f914..2a7262ab60 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,8 +4,11 @@ else mybranch = env.BRANCH_NAME node { - echo "hello here" - env.dump() + echo "Branch name" + echo env.BRANCH_NAME + echo env.CHANGE_ID + echo env.CHANGE_BRANCH + echo env.CHANGE_TARGET } pipeline { From ee8d1c4c8644ae83e7aaf04b60ef8d5bd4e4f4c0 Mon Sep 17 00:00:00 2001 From: sylvain-combe-sonarsource Date: Tue, 4 Feb 2020 15:00:32 +0100 Subject: [PATCH 09/46] try to build PR analysis --- Jenkinsfile | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2a7262ab60..13beb78058 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,16 +1,33 @@ if (env.BRANCH_NAME == 'master') - mybranch = '' + myBranch = '' else - mybranch = env.BRANCH_NAME + myBranch = env.BRANCH_NAME node { - echo "Branch name" + echo "Jenkins variables" echo env.BRANCH_NAME + echo myBranch echo env.CHANGE_ID echo env.CHANGE_BRANCH echo env.CHANGE_TARGET } +if(env.CHANGE_ID != null) // PR analysis + mvnCmdLine = 'mvn -X -B -DskipTests \ + -Dsonar.pullrequest.key=${env.CHANGE_ID} \ + -Dsonar.pullrequest.branch=${mybranch} \ + -Dsonar.pullrequest.base=${env.CHANGE_TARGET} \ + clean package sonar:sonar' +else // regular branch analysis + mvnCmdLine = 'mvn -X -B -DskipTests \ + -Dsonar.branch.name=${mybranch} \ + clean package sonar:sonar' + +node { + echo "My command line:" + echo mvnCmdLine +} + pipeline { agent { docker { @@ -24,7 +41,7 @@ pipeline { stage('Build') { steps { withSonarQubeEnv(installationName: 'ngrok syco') { - sh 'mvn -X -B -Dsonar.branch.name=${mybranch} -DskipTests clean package sonar:sonar' + sh '${mvnCmdLine}' } } } From 23c82b2e5a0704b08acc024256279920f804276a Mon Sep 17 00:00:00 2001 From: sylvain-combe-sonarsource Date: Tue, 4 Feb 2020 15:05:23 +0100 Subject: [PATCH 10/46] try to build PR analysis 2 --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 13beb78058..6d4062feac 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -15,12 +15,12 @@ node { if(env.CHANGE_ID != null) // PR analysis mvnCmdLine = 'mvn -X -B -DskipTests \ -Dsonar.pullrequest.key=${env.CHANGE_ID} \ - -Dsonar.pullrequest.branch=${mybranch} \ + -Dsonar.pullrequest.branch=${myBranch} \ -Dsonar.pullrequest.base=${env.CHANGE_TARGET} \ clean package sonar:sonar' else // regular branch analysis mvnCmdLine = 'mvn -X -B -DskipTests \ - -Dsonar.branch.name=${mybranch} \ + -Dsonar.branch.name=${myBÒranch} \ clean package sonar:sonar' node { From 104e426225a781637e9e5706ccd2e5aae281d6ef Mon Sep 17 00:00:00 2001 From: sylvain-combe-sonarsource Date: Tue, 4 Feb 2020 15:19:56 +0100 Subject: [PATCH 11/46] try to build PR analysis 3 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6d4062feac..3348db563f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -20,7 +20,7 @@ if(env.CHANGE_ID != null) // PR analysis clean package sonar:sonar' else // regular branch analysis mvnCmdLine = 'mvn -X -B -DskipTests \ - -Dsonar.branch.name=${myBÒranch} \ + -Dsonar.branch.name=${myBranch} \ clean package sonar:sonar' node { From 07c680ba6ccfd334958565cf102d13f7e94afae3 Mon Sep 17 00:00:00 2001 From: sylvain-combe-sonarsource Date: Tue, 4 Feb 2020 17:00:04 +0100 Subject: [PATCH 12/46] try to build PR analysis 4 --- Jenkinsfile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3348db563f..1faa2fd7c8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,9 +19,16 @@ if(env.CHANGE_ID != null) // PR analysis -Dsonar.pullrequest.base=${env.CHANGE_TARGET} \ clean package sonar:sonar' else // regular branch analysis - mvnCmdLine = 'mvn -X -B -DskipTests \ + mvnCmdLine = "mvn -X -B -DskipTests \ -Dsonar.branch.name=${myBranch} \ - clean package sonar:sonar' + clean package sonar:sonar" + +mvnCmdLine2 = "mvn -X -B -DskipTests \ + -Dsonar.branch.name=${env.BRANCH_NAME} \ + clean package sonar:sonar" +mvnCmdLine3 = "mvn -X -B -DskipTests \ + -Dsonar.branch.name=$myBranch \ + clean package sonar:sonar" node { echo "My command line:" From 465abcd938dc9a8b8e6768a0ded3b94a2fb0939f Mon Sep 17 00:00:00 2001 From: sylvain-combe-sonarsource Date: Tue, 4 Feb 2020 17:09:56 +0100 Subject: [PATCH 13/46] try to build PR analysis 5 --- Jenkinsfile | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1faa2fd7c8..ee3ec0ca90 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -13,22 +13,22 @@ node { } if(env.CHANGE_ID != null) // PR analysis - mvnCmdLine = 'mvn -X -B -DskipTests \ + mvnCmdLine = "mvn -X -B -DskipTests \ -Dsonar.pullrequest.key=${env.CHANGE_ID} \ -Dsonar.pullrequest.branch=${myBranch} \ -Dsonar.pullrequest.base=${env.CHANGE_TARGET} \ - clean package sonar:sonar' + clean package sonar:sonar" else // regular branch analysis mvnCmdLine = "mvn -X -B -DskipTests \ -Dsonar.branch.name=${myBranch} \ clean package sonar:sonar" -mvnCmdLine2 = "mvn -X -B -DskipTests \ - -Dsonar.branch.name=${env.BRANCH_NAME} \ - clean package sonar:sonar" -mvnCmdLine3 = "mvn -X -B -DskipTests \ - -Dsonar.branch.name=$myBranch \ - clean package sonar:sonar" +// mvnCmdLine2 = "mvn -X -B -DskipTests \ +// -Dsonar.branch.name=${env.BRANCH_NAME} \ +// clean package sonar:sonar" +// mvnCmdLine3 = "mvn -X -B -DskipTests \ +// -Dsonar.branch.name=$myBranch \ +// clean package sonar:sonar" node { echo "My command line:" @@ -48,7 +48,7 @@ pipeline { stage('Build') { steps { withSonarQubeEnv(installationName: 'ngrok syco') { - sh '${mvnCmdLine}' + sh "${mvnCmdLine}" } } } From b923272dd5dc385e998364e3a46e6ee5bcbe8e8c Mon Sep 17 00:00:00 2001 From: sylvain-combe-sonarsource Date: Tue, 4 Feb 2020 17:41:01 +0100 Subject: [PATCH 14/46] try to build PR analysis 6 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index ee3ec0ca90..9debbbbf10 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -48,7 +48,7 @@ pipeline { stage('Build') { steps { withSonarQubeEnv(installationName: 'ngrok syco') { - sh "${mvnCmdLine}" + sh '"${mvnCmdLine}"' } } } From dc1d6f1e4e7563f1d363cdf3b3479bb493a1b03a Mon Sep 17 00:00:00 2001 From: sylvain-combe-sonarsource Date: Tue, 4 Feb 2020 17:50:41 +0100 Subject: [PATCH 15/46] Revert "try to build PR analysis 6" This reverts commit b923272dd5dc385e998364e3a46e6ee5bcbe8e8c. --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9debbbbf10..ee3ec0ca90 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -48,7 +48,7 @@ pipeline { stage('Build') { steps { withSonarQubeEnv(installationName: 'ngrok syco') { - sh '"${mvnCmdLine}"' + sh "${mvnCmdLine}" } } } From f4e1219c88a50fbd2c6571663bad025a84734f76 Mon Sep 17 00:00:00 2001 From: sylvain-combe-sonarsource <59280694+sylvain-combe-sonarsource@users.noreply.github.com> Date: Fri, 28 Feb 2020 12:31:27 +0100 Subject: [PATCH 16/46] Add fetch of master for sonar scanner comparison --- Jenkinsfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index fbeb09fe81..895de57cb3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -48,7 +48,11 @@ pipeline { stage('Build') { steps { withSonarQubeEnv(installationName: 'ngrok syco') { - sh "${mvnCmdLine}" + script { + // fetch master from origin so sonar scanner comparison works + sh "git fetch --no-tags ${GIT_URL} +refs/heads/master:refs/remotes/origin/master" + sh "${mvnCmdLine}" + } } } } @@ -68,4 +72,4 @@ pipeline { } } } -} \ No newline at end of file +} From 1df2a088fb794fda5d261d78884a4ae3ecb55b2a Mon Sep 17 00:00:00 2001 From: sylvain-combe-sonarsource <59280694+sylvain-combe-sonarsource@users.noreply.github.com> Date: Fri, 28 Feb 2020 14:28:58 +0100 Subject: [PATCH 17/46] change docker image get git inside! --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 895de57cb3..6bbb60da0e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -38,7 +38,7 @@ node { pipeline { agent { docker { - image 'maven:3-alpine' + image 'masstroy/alpine-docker-java-maven' } } options { From 35a8e79929474c3bb0645e3e69e97de684ae2646 Mon Sep 17 00:00:00 2001 From: sylvain-combe-sonarsource Date: Fri, 28 Feb 2020 14:37:40 +0100 Subject: [PATCH 18/46] Fix JenkinsFile conflict --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 6bbb60da0e..1ae478e25d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -48,6 +48,7 @@ pipeline { stage('Build') { steps { withSonarQubeEnv(installationName: 'ngrok syco') { + sh "${mvnCmdLine}" script { // fetch master from origin so sonar scanner comparison works sh "git fetch --no-tags ${GIT_URL} +refs/heads/master:refs/remotes/origin/master" From ea7bdd460d445c8543ae79810ffe368afd9a9e8c Mon Sep 17 00:00:00 2001 From: sylvain-combe-sonarsource <59280694+sylvain-combe-sonarsource@users.noreply.github.com> Date: Wed, 22 Apr 2020 14:24:58 +0200 Subject: [PATCH 19/46] Align Jenkinsfile on master branch one --- Jenkinsfile | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1ae478e25d..5fac1815c7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -38,23 +38,30 @@ node { pipeline { agent { docker { - image 'masstroy/alpine-docker-java-maven' + // image 'masstroy/alpine-docker-java-maven' + image 'maven:3-alpine' + args '-v $HOME/.m2:/root/.m2' } } options { skipStagesAfterUnstable() } stages { + stage('SCM') { + steps { + git 'https://github.com/sylvain-combe-sonarsource/simple-java-maven-app.git' + } + } stage('Build') { steps { - withSonarQubeEnv(installationName: 'ngrok syco') { - sh "${mvnCmdLine}" - script { + withSonarQubeEnv(installationName: 'SQ82') { + // script { // fetch master from origin so sonar scanner comparison works - sh "git fetch --no-tags ${GIT_URL} +refs/heads/master:refs/remotes/origin/master" - sh "${mvnCmdLine}" - } - } + // sh "git fetch --no-tags ${GIT_URL} +refs/heads/master:refs/remotes/origin/master" + // sh "${mvnCmdLine}" + sh 'mvn clean package sonar:sonar' + // } + } } } stage('Test') { From 1c739018cfdd179466e243df712174424a6ffe94 Mon Sep 17 00:00:00 2001 From: sylvain-combe-sonarsource <59280694+sylvain-combe-sonarsource@users.noreply.github.com> Date: Wed, 22 Apr 2020 14:37:46 +0200 Subject: [PATCH 20/46] Back to branch and PT analysis parameters --- Jenkinsfile | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5fac1815c7..a18c14d7dd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -23,13 +23,6 @@ else // regular branch analysis -Dsonar.branch.name=${myBranch} \ clean package sonar:sonar" -// mvnCmdLine2 = "mvn -X -B -DskipTests \ -// -Dsonar.branch.name=${env.BRANCH_NAME} \ -// clean package sonar:sonar" -// mvnCmdLine3 = "mvn -X -B -DskipTests \ -// -Dsonar.branch.name=$myBranch \ -// clean package sonar:sonar" - node { echo "My command line:" echo mvnCmdLine @@ -58,8 +51,8 @@ pipeline { // script { // fetch master from origin so sonar scanner comparison works // sh "git fetch --no-tags ${GIT_URL} +refs/heads/master:refs/remotes/origin/master" - // sh "${mvnCmdLine}" - sh 'mvn clean package sonar:sonar' + sh "${mvnCmdLine}" + // sh 'mvn clean package sonar:sonar' // } } } From e920809b1bfc5fd87c6599fefd3123c2c19b7b45 Mon Sep 17 00:00:00 2001 From: sylvain-combe-sonarsource <59280694+sylvain-combe-sonarsource@users.noreply.github.com> Date: Wed, 22 Apr 2020 14:58:13 +0200 Subject: [PATCH 21/46] Fix git branch and PR code analyzed --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index a18c14d7dd..8ee06b5ce3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -42,7 +42,8 @@ pipeline { stages { stage('SCM') { steps { - git 'https://github.com/sylvain-combe-sonarsource/simple-java-maven-app.git' + // git 'https://github.com/sylvain-combe-sonarsource/simple-java-maven-app.git' + sh "git fetch --no-tags ${GIT_URL} +refs/heads/master:refs/remotes/origin/master" } } stage('Build') { From b6eb4cf03d05a374dae7baa9767e2d04ce331a36 Mon Sep 17 00:00:00 2001 From: sylvain-combe-sonarsource <59280694+sylvain-combe-sonarsource@users.noreply.github.com> Date: Wed, 22 Apr 2020 15:00:08 +0200 Subject: [PATCH 22/46] need git commands again in docker container --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8ee06b5ce3..20a8e342d9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -31,8 +31,8 @@ node { pipeline { agent { docker { - // image 'masstroy/alpine-docker-java-maven' - image 'maven:3-alpine' + image 'masstroy/alpine-docker-java-maven' + // image 'maven:3-alpine' args '-v $HOME/.m2:/root/.m2' } } From 3093490b7f7bcb0f5e7e0d13ca2c6f50a07fa84f Mon Sep 17 00:00:00 2001 From: sylvain-combe-sonarsource <59280694+sylvain-combe-sonarsource@users.noreply.github.com> Date: Wed, 22 Apr 2020 15:12:07 +0200 Subject: [PATCH 23/46] do I need a git command at all --- Jenkinsfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 20a8e342d9..d9eafe5526 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -31,8 +31,8 @@ node { pipeline { agent { docker { - image 'masstroy/alpine-docker-java-maven' - // image 'maven:3-alpine' + // image 'masstroy/alpine-docker-java-maven' + image 'maven:3-alpine' args '-v $HOME/.m2:/root/.m2' } } @@ -43,7 +43,8 @@ pipeline { stage('SCM') { steps { // git 'https://github.com/sylvain-combe-sonarsource/simple-java-maven-app.git' - sh "git fetch --no-tags ${GIT_URL} +refs/heads/master:refs/remotes/origin/master" + // sh "git fetch --no-tags ${GIT_URL} +refs/heads/master:refs/remotes/origin/master" + sh "echo ${GIT_URL}" } } stage('Build') { From 57aab0fc84cd4eacad13f18855757c99c2c318fe Mon Sep 17 00:00:00 2001 From: sylvain-combe-sonarsource Date: Wed, 22 Apr 2020 15:24:15 +0200 Subject: [PATCH 24/46] align project keys --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index d0a3e54a9d..5d9ce1cea3 100644 --- a/pom.xml +++ b/pom.xml @@ -42,5 +42,6 @@ 1.8 1.8 + sylvain-combe-sonarsource_simple-java-maven-app From a2522283cfc19aea5be6f34c94fce417199a2e92 Mon Sep 17 00:00:00 2001 From: sylvain-combe-sonarsource Date: Wed, 22 Apr 2020 15:27:33 +0200 Subject: [PATCH 25/46] resolve conflict on pom.xml --- pom.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pom.xml b/pom.xml index 5d9ce1cea3..f7eebfb4b3 100644 --- a/pom.xml +++ b/pom.xml @@ -43,5 +43,8 @@ 1.8 1.8 sylvain-combe-sonarsource_simple-java-maven-app + sylvain-combe-sonarsource + https://sonarcloud.io + d58f0d63d88254491a09164a0deb397298a99f6e From 432b74652d602744ddc0c0c59b34607fe429f589 Mon Sep 17 00:00:00 2001 From: sylvain-combe-sonarsource Date: Wed, 22 Apr 2020 15:57:36 +0200 Subject: [PATCH 26/46] add quality gate status check --- Jenkinsfile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index d9eafe5526..f28be88229 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -74,5 +74,14 @@ pipeline { sh './jenkins/scripts/deliver.sh' } } + stage("Quality Gate") { + steps { + timeout(time: 1, unit: 'HOURS') { + // Parameter indicates whether to set pipeline to UNSTABLE if Quality Gate fails + // true = set pipeline to UNSTABLE, false = don't + waitForQualityGate abortPipeline: true + } + } + } } } From 7c4de5dcfd7e2a52be8dbd0fa1835b940151f4c0 Mon Sep 17 00:00:00 2001 From: sylvain-combe-sonarsource Date: Wed, 22 Apr 2020 17:38:04 +0200 Subject: [PATCH 27/46] new attempt with no analysis parameter --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f28be88229..9e2a2cdac3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -53,8 +53,8 @@ pipeline { // script { // fetch master from origin so sonar scanner comparison works // sh "git fetch --no-tags ${GIT_URL} +refs/heads/master:refs/remotes/origin/master" - sh "${mvnCmdLine}" - // sh 'mvn clean package sonar:sonar' + // sh "${mvnCmdLine}" + sh 'mvn clean package sonar:sonar' // } } } From 03b6fcfa8a320d86304518bd5a0a74720071ce88 Mon Sep 17 00:00:00 2001 From: sylvain-combe-sonarsource Date: Wed, 22 Apr 2020 17:43:16 +0200 Subject: [PATCH 28/46] add cache for plugins --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index 9e2a2cdac3..0fd7102920 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -34,6 +34,7 @@ pipeline { // image 'masstroy/alpine-docker-java-maven' image 'maven:3-alpine' args '-v $HOME/.m2:/root/.m2' + args '-v $HOME/.sonar/cache:/root/.sonar/cache' } } options { From 544d798ba568a4b800bf69596a3835d32222d845 Mon Sep 17 00:00:00 2001 From: sylvain-combe-sonarsource Date: Wed, 22 Apr 2020 17:44:59 +0200 Subject: [PATCH 29/46] use volume mount for caches --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0fd7102920..ee8ff57c8c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -33,8 +33,8 @@ pipeline { docker { // image 'masstroy/alpine-docker-java-maven' image 'maven:3-alpine' - args '-v $HOME/.m2:/root/.m2' - args '-v $HOME/.sonar/cache:/root/.sonar/cache' + args '-v mavencache:/root/.m2' + args '-v sonarcache:/root/.sonar/cache' } } options { From abed2e34ce7935852f0fdfcb65f56a885f41152a Mon Sep 17 00:00:00 2001 From: sylvain-combe-sonarsource Date: Wed, 22 Apr 2020 17:46:49 +0200 Subject: [PATCH 30/46] mandatory parameters back --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ee8ff57c8c..cac073da7d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -54,8 +54,8 @@ pipeline { // script { // fetch master from origin so sonar scanner comparison works // sh "git fetch --no-tags ${GIT_URL} +refs/heads/master:refs/remotes/origin/master" - // sh "${mvnCmdLine}" - sh 'mvn clean package sonar:sonar' + sh "${mvnCmdLine}" + // sh 'mvn clean package sonar:sonar' // } } } From e1e37c1810ebc4d773996df73e6a2c9a3d8b4015 Mon Sep 17 00:00:00 2001 From: sylvain-combe-sonarsource Date: Wed, 22 Apr 2020 18:04:47 +0200 Subject: [PATCH 31/46] user home tweaks --- Jenkinsfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index cac073da7d..f785270960 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,10 +17,12 @@ if(env.CHANGE_ID != null) // PR analysis -Dsonar.pullrequest.key=${env.CHANGE_ID} \ -Dsonar.pullrequest.branch=${myBranch} \ -Dsonar.pullrequest.base=${env.CHANGE_TARGET} \ + -Duser.home=$HOME \ clean package sonar:sonar" else // regular branch analysis mvnCmdLine = "mvn -X -B -DskipTests \ -Dsonar.branch.name=${myBranch} \ + -Duser.home=$HOME \ clean package sonar:sonar" node { @@ -33,8 +35,8 @@ pipeline { docker { // image 'masstroy/alpine-docker-java-maven' image 'maven:3-alpine' - args '-v mavencache:/root/.m2' - args '-v sonarcache:/root/.sonar/cache' + args '-v mavencache:$HOME/.m2' \ + '-v sonarcache:$HOME/.sonar/cache' } } options { From c9a4c10cb01134d0d818322a71ded7ef96ee79e2 Mon Sep 17 00:00:00 2001 From: sylvain-combe-sonarsource Date: Wed, 22 Apr 2020 18:07:54 +0200 Subject: [PATCH 32/46] fix args --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f785270960..8b24898131 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -35,8 +35,8 @@ pipeline { docker { // image 'masstroy/alpine-docker-java-maven' image 'maven:3-alpine' - args '-v mavencache:$HOME/.m2' \ - '-v sonarcache:$HOME/.sonar/cache' + args '-v mavencache:$HOME/.m2 \ + -v sonarcache:$HOME/.sonar/cache' } } options { From 2f5f359a493c4a1f4b220eb40e273eca34400862 Mon Sep 17 00:00:00 2001 From: sylvain-combe-sonarsource Date: Wed, 22 Apr 2020 18:12:35 +0200 Subject: [PATCH 33/46] HOME not existing --- Jenkinsfile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8b24898131..3f54f4e6a0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,12 +17,10 @@ if(env.CHANGE_ID != null) // PR analysis -Dsonar.pullrequest.key=${env.CHANGE_ID} \ -Dsonar.pullrequest.branch=${myBranch} \ -Dsonar.pullrequest.base=${env.CHANGE_TARGET} \ - -Duser.home=$HOME \ clean package sonar:sonar" else // regular branch analysis mvnCmdLine = "mvn -X -B -DskipTests \ -Dsonar.branch.name=${myBranch} \ - -Duser.home=$HOME \ clean package sonar:sonar" node { @@ -35,8 +33,8 @@ pipeline { docker { // image 'masstroy/alpine-docker-java-maven' image 'maven:3-alpine' - args '-v mavencache:$HOME/.m2 \ - -v sonarcache:$HOME/.sonar/cache' + args '-v maven-cache:$HOME/.m2 \ + -v sonar-cache:$HOME/.sonar/cache' } } options { @@ -56,7 +54,7 @@ pipeline { // script { // fetch master from origin so sonar scanner comparison works // sh "git fetch --no-tags ${GIT_URL} +refs/heads/master:refs/remotes/origin/master" - sh "${mvnCmdLine}" + sh "${mvnCmdLine} -Duser.home=$HOME" // sh 'mvn clean package sonar:sonar' // } } From b6576cd2df8c366a55b447200af85e3f96877164 Mon Sep 17 00:00:00 2001 From: sylvain-combe-sonarsource Date: Wed, 22 Apr 2020 18:15:09 +0200 Subject: [PATCH 34/46] root be it --- Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3f54f4e6a0..4cee5a8357 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -33,8 +33,8 @@ pipeline { docker { // image 'masstroy/alpine-docker-java-maven' image 'maven:3-alpine' - args '-v maven-cache:$HOME/.m2 \ - -v sonar-cache:$HOME/.sonar/cache' + args '-v maven-cache:$root/.m2 \ + -v sonar-cache:$root/.sonar/cache' } } options { @@ -54,7 +54,7 @@ pipeline { // script { // fetch master from origin so sonar scanner comparison works // sh "git fetch --no-tags ${GIT_URL} +refs/heads/master:refs/remotes/origin/master" - sh "${mvnCmdLine} -Duser.home=$HOME" + sh "${mvnCmdLine}" // sh 'mvn clean package sonar:sonar' // } } From 78752e5776a1edefe003e87be8978e04aaef0270 Mon Sep 17 00:00:00 2001 From: sylvain-combe-sonarsource Date: Wed, 22 Apr 2020 18:16:13 +0200 Subject: [PATCH 35/46] root be it 2 --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4cee5a8357..196d1681b8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -33,8 +33,8 @@ pipeline { docker { // image 'masstroy/alpine-docker-java-maven' image 'maven:3-alpine' - args '-v maven-cache:$root/.m2 \ - -v sonar-cache:$root/.sonar/cache' + args '-v maven-cache:/root/.m2 \ + -v sonar-cache:/root/.sonar/cache' } } options { From f6f69d70c7e33471fcaa998b68bc118aa27c81ac Mon Sep 17 00:00:00 2001 From: sylvain-combe-sonarsource Date: Thu, 23 Apr 2020 11:14:18 +0200 Subject: [PATCH 36/46] remove git url not found anymore in SCM step --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 196d1681b8..6a60e31c66 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -43,9 +43,9 @@ pipeline { stages { stage('SCM') { steps { - // git 'https://github.com/sylvain-combe-sonarsource/simple-java-maven-app.git' + // git 'https://github.com/sylvain-combe-sonarsource/simple-java-maven-app.git' // sh "git fetch --no-tags ${GIT_URL} +refs/heads/master:refs/remotes/origin/master" - sh "echo ${GIT_URL}" + sh "echo toto" } } stage('Build') { From a9e0793f2a723725b2c9e9ba4e11e843179abb17 Mon Sep 17 00:00:00 2001 From: sylvain-combe-sonarsource Date: Mon, 8 Feb 2021 14:15:12 +0100 Subject: [PATCH 37/46] Add some useless code --- src/main/java/com/mycompany/app/App.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/mycompany/app/App.java b/src/main/java/com/mycompany/app/App.java index a79fe4567b..d55f70a1f1 100644 --- a/src/main/java/com/mycompany/app/App.java +++ b/src/main/java/com/mycompany/app/App.java @@ -39,5 +39,8 @@ private final String getMessage() throws InterruptedException { return message; } + private final String doNothing() throws InterruptedException { + return null; + } } From 416840839da857d7c30dfd86de045fce7a340a11 Mon Sep 17 00:00:00 2001 From: sylvain-combe-sonarsource <59280694+sylvain-combe-sonarsource@users.noreply.github.com> Date: Thu, 25 Mar 2021 20:40:12 +0100 Subject: [PATCH 38/46] Create azure-pipelines-1.yml --- azure-pipelines-1.yml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 azure-pipelines-1.yml diff --git a/azure-pipelines-1.yml b/azure-pipelines-1.yml new file mode 100644 index 0000000000..3ee9211da7 --- /dev/null +++ b/azure-pipelines-1.yml @@ -0,0 +1,38 @@ +# Maven +# Build your Java project and run tests with Apache Maven. +# Add steps that analyze code, save build artifacts, deploy, and more: +# https://docs.microsoft.com/azure/devops/pipelines/languages/java + +trigger: +- master +- new* + +pool: + vmImage: ubuntu-latest + +steps: + +- task: SonarCloudPrepare@1 + inputs: + SonarCloud: 'SonarCloudGH' + organization: 'syco26' + scannerMode: 'Other' + extraProperties: | + # Additional properties that will be passed to the scanner, + # Put one key=value per line, example: + sonar.projectName=simple-java-maven-app + sonar.projectKey=syco26_simple-java-maven-app +- task: Maven@3 + inputs: + mavenPomFile: 'pom.xml' + mavenOptions: '-Xmx3072m' + javaHomeOption: 'JDKVersion' + jdkVersionOption: '1.11' + jdkArchitectureOption: 'x64' + publishJUnitResults: true + testResultsFiles: '**/surefire-reports/TEST-*.xml' + goals: 'package sonar:sonar' + +- task: SonarCloudPublish@1 + inputs: + pollingTimeoutSec: '300' From 087757a1e6e44f69d32a9756ee4e232197c5f570 Mon Sep 17 00:00:00 2001 From: sylvain-combe-sonarsource <59280694+sylvain-combe-sonarsource@users.noreply.github.com> Date: Thu, 25 Mar 2021 20:43:19 +0100 Subject: [PATCH 39/46] Add PR triggers --- azure-pipelines-1.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/azure-pipelines-1.yml b/azure-pipelines-1.yml index 3ee9211da7..b57af9b487 100644 --- a/azure-pipelines-1.yml +++ b/azure-pipelines-1.yml @@ -6,6 +6,9 @@ trigger: - master - new* +pr: +- master +- releases/* pool: vmImage: ubuntu-latest From feb93956406b02bb87be886aa478ba9fdf3efd1c Mon Sep 17 00:00:00 2001 From: Sylvain <59280694+sylvain-combe-sonarsource@users.noreply.github.com> Date: Fri, 4 Nov 2022 09:22:30 +0100 Subject: [PATCH 40/46] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 40efacc879..c291afb282 100644 --- a/README.md +++ b/README.md @@ -13,3 +13,5 @@ The `jenkins` directory contains an example of the `Jenkinsfile` (i.e. Pipeline) you'll be creating yourself during the tutorial and the `scripts` subdirectory contains a shell script with commands that are executed when Jenkins processes the "Deliver" stage of your Pipeline. + +test update From 4ba69bc4aba3cd461dee81ee9e1c4a04023df6fa Mon Sep 17 00:00:00 2001 From: Sylvain <59280694+sylvain-combe-sonarsource@users.noreply.github.com> Date: Fri, 4 Nov 2022 09:28:05 +0100 Subject: [PATCH 41/46] Create main.yml --- .github/workflows/main.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000000..ef6d25ab7c --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,34 @@ +name: Build +on: + push: + pull_request: + types: [opened, synchronize, reopened] +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Cache SonarCloud packages + uses: actions/cache@v1 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Cache Maven packages + uses: actions/cache@v1 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Build and analyze + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar From 2e230b2304b65d60053110fcc956cdf03bdcd876 Mon Sep 17 00:00:00 2001 From: Sylvain <59280694+sylvain-combe-sonarsource@users.noreply.github.com> Date: Fri, 4 Nov 2022 09:32:24 +0100 Subject: [PATCH 42/46] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ef6d25ab7c..8e492d45e7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,6 +29,6 @@ jobs: restore-keys: ${{ runner.os }}-m2 - name: Build and analyze env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar From 7b14944c8825aedbd09a7f395978e85dce8eb955 Mon Sep 17 00:00:00 2001 From: Sylvain <59280694+sylvain-combe-sonarsource@users.noreply.github.com> Date: Fri, 4 Nov 2022 09:33:58 +0100 Subject: [PATCH 43/46] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8e492d45e7..77bd9d8412 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,5 +30,5 @@ jobs: - name: Build and analyze env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} + SONAR_HOST_URL: ${{ secrets.SONAR_SQ_URL }} run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar From d7a2fd05afcadf01b3c289b326b54db53f659e85 Mon Sep 17 00:00:00 2001 From: Sylvain <59280694+sylvain-combe-sonarsource@users.noreply.github.com> Date: Fri, 4 Nov 2022 09:48:07 +0100 Subject: [PATCH 44/46] Update main.yml --- .github/workflows/main.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 77bd9d8412..03794a9734 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,7 +2,10 @@ name: Build on: push: pull_request: - types: [opened, synchronize, reopened] + branches: + - main + - 'master' + - 'releases/**' jobs: build: name: Build From 7b10e5b802c64c6f51aa5381513adfc2716b70dc Mon Sep 17 00:00:00 2001 From: Sylvain <59280694+sylvain-combe-sonarsource@users.noreply.github.com> Date: Fri, 4 Nov 2022 09:51:15 +0100 Subject: [PATCH 45/46] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 03794a9734..bf0a5710c8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,4 +34,4 @@ jobs: env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: ${{ secrets.SONAR_SQ_URL }} - run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar + run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -X From e4a95091895cf82ce71e84342c58aaebbfb78199 Mon Sep 17 00:00:00 2001 From: Sylvain <59280694+sylvain-combe-sonarsource@users.noreply.github.com> Date: Fri, 4 Nov 2022 10:12:09 +0100 Subject: [PATCH 46/46] Update App.java --- src/main/java/com/mycompany/app/App.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/mycompany/app/App.java b/src/main/java/com/mycompany/app/App.java index 0c31aea3a7..05d9cc1a33 100644 --- a/src/main/java/com/mycompany/app/App.java +++ b/src/main/java/com/mycompany/app/App.java @@ -43,7 +43,7 @@ private final String doNothing() throws InterruptedException { return null; } - private class S2259FalsePositive { + private static class S2259FalsePositive { private enum Valid { OK, NOT_OK; }