From 7c69881cbef770e5366384449cf8687c6c3ec9f7 Mon Sep 17 00:00:00 2001 From: Abdul Rahim Date: Mon, 16 Sep 2024 17:21:31 +0530 Subject: [PATCH] graadle spotbugs --- Jenkinsfile | 14 +------------- payara-micro-gradle-plugin/build.gradle | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1da713b..32a6acc 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -15,18 +15,6 @@ pipeline { } stages { - stage('Checkout master') { - steps { - script { - checkout changelog: false, poll: true, scm: [$class: 'GitSCM', - branches: [[name: "master"]], - doGenerateSubmoduleConfigurations: false, - extensions: [], - submoduleCfg: [], - userRemoteConfigs: [[credentialsId: 'payara-devops-github-personal-access-token-as-username-password', url:"https://github.com/payara/ecosystem-gradle.git"]]] - } - } - } stage('Build') { steps { script { @@ -34,7 +22,7 @@ pipeline { sh ''' ls -lrt cd payara-micro-gradle-plugin - gradle clean build -x check + gradle clean build -x check ''' echo '*#*#*#*#*#*#*#*#*#*#*#*# Built SRC *#*#*#*#*#*#*#*#*#*#*#*#*#*#*#' } diff --git a/payara-micro-gradle-plugin/build.gradle b/payara-micro-gradle-plugin/build.gradle index acf83ac..8553156 100644 --- a/payara-micro-gradle-plugin/build.gradle +++ b/payara-micro-gradle-plugin/build.gradle @@ -3,6 +3,7 @@ plugins { id 'maven-publish' id 'java' id 'java-gradle-plugin' + id 'com.github.spotbugs' version '5.0.14' // Add SpotBugs plugin } group = 'fish.payara.gradle.plugins' @@ -28,6 +29,21 @@ dependencies { testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.2' } +// SpotBugs Configuration +spotbugs { + toolVersion = '4.2.3' // Use the latest stable version + effort = 'max' // Use maximum effort for more detailed analysis + reportLevel = 'low' // Report all issues (low, medium, high) + ignoreFailures = true // Set to true if you want the build to continue even if there are violations +} + +tasks.withType(com.github.spotbugs.snom.SpotBugsTask) { + reports { + xml.enabled = true // Enable XML report generation + html.enabled = false // Enable HTML report generation + } +} + test { useJUnitPlatform() testLogging {