The following plugin provides functionality available through Pipeline-compatible steps. Read more about how to integrate steps into your Pipeline in the Steps section of the Pipeline Syntax page.

For a list of other such plugins, see the Pipeline Steps Reference page.

Metrics Aggregation

metrics: Record Metrics

  • classPathFile (optional)
    In order to use Type resolution during the analysis, PMD has to have access to the classpath of the project.

    In case of a maven build, a file containing the classpath can be generated with: mvn dependency:build-classpath -Dmdep.outputFile=cp.txt Alternatively it is also possible include this in your pom.xml so it is generated as part of the build. See https://maven.apache.org/plugins/maven-dependency-plugin/usage.html for more information.

    When using gradle, a file containing the classpath can be generated by adding task removecp(type: Delete) { delete "cp.txt" } subprojects { task printcp { new File(rootDir, "cp.txt").append(":" + sourceSets.main.runtimeClasspath.join(':')) } } to the end of your build.gradle and executing gradlew removecp printcp.

    • Type: String
  • filePattern (optional)
    • Type: String

step([$class: 'MetricsRecorder']): Record Metrics

  • classPathFile (optional)
    • Type: String
  • filePattern (optional)
    • Type: String

Was this page helpful?

Please submit your feedback about this page through this quick form.

Alternatively, if you don't wish to complete the quick form, you can simply indicate if you found this page helpful?

    


See existing feedback here.