[
https://issues.apache.org/jira/browse/MPMD-383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17906412#comment-17906412
]
Elliotte Rusty Harold commented on MPMD-383:
--------------------------------------------
I don't think it does depend on how how maven-pmd-plugin is used in the
project. It's always advisory, no exceptions. It never changes the built code.
If PMD itself fails. the build should continue. The chance that PMD actually
would have found a critical bug if it had run is small. In the event that PMD
is unable to analyze code, the best option is not to fail the build. In your
case where there's a bug in PMD, what would you do anyway? Turn PMD off and
proceed. Let's avoid that extra step.
In practice fail-on-warning for PMD is not followed. Devs try it, and it's
quickly turned off, usually globally though occasionally locally by marking
exceptions to the violated rules in the code. Rarely it will survive until the
dev who turned it on leaves the team, and then the team turns it off. But
usually it gets turned off way before that. It's just not reliable enough or
useful enough to make fail-on-warning practical.
> PMD should fail when there is a processing error
> ------------------------------------------------
>
> Key: MPMD-383
> URL: https://issues.apache.org/jira/browse/MPMD-383
> Project: Maven PMD Plugin
> Issue Type: Wish
> Components: PMD
> Affects Versions: 3.21.0
> Reporter: Thomas Nikolay
> Priority: Major
> Attachments: image-2023-07-28-13-34-28-717.png
>
>
> We had the case that PMD can't process some processing error but the build
> does not fail.
>
> {noformat}
> [2023-07-28T10:59:44.102Z] [INFO] --- maven-pmd-plugin:3.20.0:pmd (pmd) @
> mod-config-client-cst ---
> [2023-07-28T10:59:44.692Z] [INFO] PMD version: 6.53.0
> [2023-07-28T10:59:45.672Z] [WARNING] Removed misconfigured rule:
> GK-SAP-ApacheLoggerDeniedRule cause: missing value
> [2023-07-28T10:59:45.672Z] [WARNING] There are 3 PMD processing errors:
> [2023-07-28T10:59:45.672Z] [WARNING]
> /var/lib/hudson-slave/workspace/hmr.MAIN.00-FEATURE-BRANCHES/pos/config/mod-config-client-cst/src/test/java/com/gk_software/cst/client/AppInfoProviderImpl_CST_Test.java:
> PMDException: Error while processing
> /var/lib/hudson-slave/workspace/hmr.MAIN.00-FEATURE-BRANCHES/pos/config/mod-config-client-cst/src/test/java/com/gk_software/cst/client/AppInfoProviderImpl_CST_Test.java
> [2023-07-28T10:59:45.948Z]
> /var/lib/hudson-slave/workspace/hmr.MAIN.00-FEATURE-BRANCHES/pos/config/mod-config-client-cst/src/test/java/com/gk_software/pos/api/model/config/component/client/print/additional_printout/Trigger_CFH_CST_Test.java:
> PMDException: Error while processing
> /var/lib/hudson-slave/workspace/hmr.MAIN.00-FEATURE-BRANCHES/pos/config/mod-config-client-cst/src/test/java/com/gk_software/pos/api/model/config/component/client/print/additional_printout/Trigger_CFH_CST_Test.java
> [2023-07-28T10:59:45.948Z]
> /var/lib/hudson-slave/workspace/hmr.MAIN.00-FEATURE-BRANCHES/pos/config/mod-config-client-cst/src/main/java/com/gk_software/pos/api/model/config/component/client/print/additional_printout/Trigger_CFH_CST.java:
> PMDException: Error while processing
> /var/lib/hudson-slave/workspace/hmr.MAIN.00-FEATURE-BRANCHES/pos/config/mod-config-client-cst/src/main/java/com/gk_software/pos/api/model/config/component/client/print/additional_printout/Trigger_CFH_CST.java
> [2023-07-28T10:59:45.948Z] [INFO] Rendering content with
> org.apache.maven.skins:maven-default-skin:jar:1.3 skin.
> [2023-07-28T10:59:46.210Z] [INFO]
> [2023-07-28T10:59:46.210Z] [INFO] <<< maven-pmd-plugin:3.20.0:check
> (pmd-check) < :pmd @ mod-config-client-cst <<<
> {noformat}
>
> My expectation would be that the build failed when there a processing errors.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)