1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2024-12-12 10:55:20 +02:00
sap-jenkins-library/vars/piperPipelineStageMavenStaticCodeChecks.groovy
Florian Geckeler bd92804745
Add static code checks stage (#1308)
* Add static code checks stage
* Rework go step to accept thresholds for the checks and fail maven build if above the thresholds
2020-03-30 15:59:59 +02:00

29 lines
935 B
Groovy

import com.sap.piper.ConfigurationLoader
import com.sap.piper.GenerateStageDocumentation
import com.sap.piper.QualityCheck
import com.sap.piper.ReportAggregator
import static com.sap.piper.Prerequisites.checkScript
import groovy.transform.Field
@Field String STEP_NAME = getClass().getName()
@Field Set GENERAL_CONFIG_KEYS = []
@Field Set STEP_CONFIG_KEYS = GENERAL_CONFIG_KEYS
@Field Set PARAMETER_KEYS = STEP_CONFIG_KEYS
/**
* Execute static code checks for Maven based projects. This stage enforces SAP Cloud SDK specific PND rulesets as well as SpotBugs include filter.
*
*/
@GenerateStageDocumentation(defaultStageName = 'mavenExecuteStaticCodeChecks')
void call(Map parameters = [:]) {
String stageName = 'mavenExecuteStaticCodeChecks'
final script = checkScript(this, parameters) ?: null
piperStageWrapper(stageName: stageName, script: script) {
mavenExecuteStaticCodeChecks(script: script)
}
}