github.com/jaylevin/jenkins-library@v1.230.4/resources/metadata/mavenExecuteStaticCodeChecks.yaml (about) 1 metadata: 2 name: mavenExecuteStaticCodeChecks 3 aliases: 4 - name: mavenExecute 5 deprecated: false 6 description: Execute static code checks for Maven based projects. The plugins SpotBugs and PMD are used. 7 longDescription: | 8 Executes Spotbugs Maven plugin as well as Pmd Maven plugin for static code checks. 9 SpotBugs is a program to find bugs in Java programs. It looks for instances of “bug patterns” — code instances that are likely to be errors. 10 For more information please visit https://spotbugs.readthedocs.io/en/latest/maven.html 11 PMD is a source code analyzer. It finds common programming flaws like unused variables, empty catch blocks, unnecessary object creation, and so forth. It supports Java, JavaScript, Salesforce.com Apex and Visualforce, PLSQL, Apache Velocity, XML, XSL. 12 For more information please visit https://pmd.github.io/. 13 The plugins should be configured in the respective pom.xml. 14 For SpotBugs include- and exclude filters as well as maximum allowed violations are conifgurable via .pipeline/config.yml. 15 For PMD the failure priority and the max allowed violations are configurable via .pipeline/config.yml. 16 17 spec: 18 inputs: 19 params: 20 - name: spotBugs 21 description: Parameter to turn off SpotBugs. 22 type: bool 23 default: true 24 scope: 25 - PARAMETERS 26 - STAGES 27 - STEPS 28 - name: pmd 29 description: Parameter to turn off PMD. 30 type: bool 31 default: true 32 scope: 33 - PARAMETERS 34 - STAGES 35 - STEPS 36 - name: mavenModulesExcludes 37 description: Maven modules which should be excluded by the static code checks. By default the modules 'unit-tests' and 'integration-tests' will be excluded. 38 type: "[]string" 39 scope: 40 - PARAMETERS 41 - STAGES 42 - STEPS 43 - name: spotBugsExcludeFilterFile 44 description: Path to a filter file with bug definitions which should be excluded. 45 type: string 46 scope: 47 - PARAMETERS 48 - STAGES 49 - STEPS 50 aliases: 51 - name: spotBugs/excludeFilterFile 52 - name: spotBugsIncludeFilterFile 53 description: Path to a filter file with bug definitions which should be included. 54 type: string 55 scope: 56 - PARAMETERS 57 - STAGES 58 - STEPS 59 aliases: 60 - name: spotBugs/includeFilterFile 61 - name: spotBugsMaxAllowedViolations 62 description: The maximum number of failures allowed before execution fails. 63 type: int 64 scope: 65 - PARAMETERS 66 - STAGES 67 - STEPS 68 aliases: 69 - name: spotBugs/maxAllowedViolations 70 - name: pmdFailurePriority 71 description: What priority level to fail the build on. PMD violations are assigned a priority from 1 (most severe) to 5 (least severe) according the the rule's priority. Violations at or less than this priority level are considered failures and will fail the build if failOnViolation=true and the count exceeds maxAllowedViolations. The other violations will be regarded as warnings and will be displayed in the build output if verbose=true. Setting a value of 5 will treat all violations as failures, which may cause the build to fail. Setting a value of 1 will treat all violations as warnings. Only values from 1 to 5 are valid. 72 type: int 73 scope: 74 - PARAMETERS 75 - STAGES 76 - STEPS 77 aliases: 78 - name: pmd/failurePriority 79 - name: pmdMaxAllowedViolations 80 description: The maximum number of failures allowed before execution fails. Used in conjunction with failOnViolation=true and utilizes failurePriority. This value has no meaning if failOnViolation=false. If the number of failures is greater than this number, the build will be failed. If the number of failures is less than or equal to this value, then the build will not be failed. 81 type: int 82 scope: 83 - PARAMETERS 84 - STAGES 85 - STEPS 86 aliases: 87 - name: pmd/maxAllowedViolations 88 89 # Global maven settings, should be added to all maven steps 90 - name: projectSettingsFile 91 type: string 92 description: Path to the mvn settings file that should be used as project settings file. 93 scope: 94 - GENERAL 95 - STEPS 96 - STAGES 97 - PARAMETERS 98 aliases: 99 - name: maven/projectSettingsFile 100 - name: globalSettingsFile 101 type: string 102 description: Path to the mvn settings file that should be used as global settings file. 103 scope: 104 - GENERAL 105 - STEPS 106 - STAGES 107 - PARAMETERS 108 aliases: 109 - name: maven/globalSettingsFile 110 - name: m2Path 111 type: string 112 description: Path to the location of the local repository that should be used. 113 scope: 114 - GENERAL 115 - STEPS 116 - STAGES 117 - PARAMETERS 118 aliases: 119 - name: maven/m2Path 120 - name: logSuccessfulMavenTransfers 121 type: bool 122 description: Configures maven to log successful downloads. This is set to `false` by default to reduce the noise in build logs. 123 scope: 124 - GENERAL 125 - STEPS 126 - STAGES 127 - PARAMETERS 128 default: false 129 aliases: 130 - name: maven/logSuccessfulMavenTransfers 131 - name: installArtifacts 132 type: bool 133 description: 134 "If enabled, it will install all artifacts to the local maven repository to make them available before running the static code checks. 135 This is required if any maven module has dependencies to other modules in the repository and they were not installed before." 136 scope: 137 - GENERAL 138 - STEPS 139 - STAGES 140 - PARAMETERS 141 142 containers: 143 - name: mvn 144 image: maven:3.6-jdk-8