jenkins-infra / pipeline-library

Collection of custom steps and variables for our Jenkins instance(s)
295 stars 136 forks source link

Read multiple result files with the pattern for PMD and CheckStyle #850

Closed uhafner closed 6 months ago

uhafner commented 6 months ago

When a project build creates multiple CheckStyle or PMD reports (e.g., different rulesets for test and production code, PMD Java and PMD JavaScript results) then the current buildPlugin setup cannot handle these results. E.g., my plugins create a structure:

target/checkstyle-java/checkstyle-result.xml
target/checkstyle-tests/checkstyle-result.xml
target/pmd-java/pmd.xml
target/pmd-javascript/pmd.xml
target/pmd-tests/pmd.xml

In order to pick up those files as well, the pattern should be changed to support those structures as well.

Output for projects with subfolder structure:

Searching for all files in '/var/data/workspace/history-coverage-model' that match the pattern 'target/**/checkstyle-result.xml'
Traversing of symbolic links: enabled
-> found 2 files
Successfully parsed file /var/data/workspace/history-coverage-model/target/checkstyle-java/checkstyle-result.xml
-> found 0 issues (skipped 0 duplicates)
Successfully processed file 'target/checkstyle-java/checkstyle-result.xml'
Successfully parsed file /var/data/workspace/history-coverage-model/target/checkstyle-tests/checkstyle-result.xml

Output for projects with default single report structure:

Searching for all files in '/var/data/workspace/history-coverage-model' that match the pattern 'target/**/checkstyle-result.xml'
Traversing of symbolic links: enabled
-> found 1 file
Successfully parsed file /var/data/workspace/history-coverage-model/target/checkstyle-result.xml
-> found 0 issues (skipped 0 duplicates)
Successfully processed file 'target/checkstyle-result.xml'