[
https://issues.apache.org/jira/browse/NIFI-14859?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18013829#comment-18013829
]
Lars Francke commented on NIFI-14859:
-------------------------------------
Maybe I misunderstand: PMD is picking those up for me when it's run (during the
contrib-check profile run).
The current plugin configuration looks like this:
{code:java}
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<configuration>
<printFailingErrors>true</printFailingErrors>
<linkXRef>false</linkXRef>
<includeTests>true</includeTests>
<targetJdk>${maven.compiler.release}</targetJdk>
<rulesets>
<ruleset>${maven.multiModuleProjectDirectory}/pmd-ruleset.xml</ruleset>
</rulesets>
</configuration>
</plugin> {code}
So, during a normal build PMD does not run. I'm not sure what the intention is.
Only during {{contrib-check}} does it gain an execution:
{code:java}
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<executions>
<execution>
<id>check</id>
<phase>compile</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin> {code}
Do you want it to check also during a normal run? In that case I am happy to
include that in my PR.
> contrib-check profile fails due to PMD errors
> ---------------------------------------------
>
> Key: NIFI-14859
> URL: https://issues.apache.org/jira/browse/NIFI-14859
> Project: Apache NiFi
> Issue Type: Bug
> Affects Versions: 2.5.0
> Reporter: Lars Francke
> Assignee: Lars Francke
> Priority: Minor
>
> The [pull request
> template|https://github.com/apache/nifi/blob/main/.github/PULL_REQUEST_TEMPLATE.md]
> suggests running {{{}mvn clean install -P contrib-check{}}}.
> (Aside: It may make sense to adjust the PR template to use the mvn wrapper
> instead to get the intendend maven version)
> On current main this fails due to various PMD warnings.
> Excerpt:
> {code:java}
> [WARNING] PMD Failure:
> org.apache.nifi.web.search.attributematchers.ConnectivityMatcherTest:38
> Rule:MissingOverride Priority:3 The method 'setUp()' is missing an @Override
> annotation..
> [WARNING] PMD Failure:
> org.apache.nifi.web.search.attributematchers.ParameterMatcherTest:35
> Rule:MissingOverride Priority:3 The method 'setUp()' is missing an @Override
> annotation..
> [WARNING] PMD Failure:
> org.apache.nifi.web.search.attributematchers.PrioritiesMatcherTest:40
> Rule:MissingOverride Priority:3 The method 'setUp()' is missing an @Override
> annotation..
> [WARNING] PMD Failure:
> org.apache.nifi.web.search.attributematchers.ProcessGroupMatcherTest:33
> Rule:MissingOverride Priority:3 The method 'setUp()' is missing an @Override
> annotation.. {code}
> I have not fixed all of them yet but there are more of these.
> This aborts the build.
> There are [CI
> builds|https://github.com/apache/nifi/blob/52f060835dd36c0d0cd532637ce36f2fd0d76582/.github/workflows/code-compliance.yml#L55-L62]
> using the contrib-check profile but they only run the [validate phase
> |https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html]
> which does not trigger the PMD run.
> This has probably been in place since
> https://issues.apache.org/jira/browse/NIFI-14821 and similar issues /cc
> [~dstiegli1]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)