Bukama opened a new pull request, #794: URL: https://github.com/apache/maven-pmd-plugin/pull/794
The check goals now run the analysis themselves. They always create the XML result files (pmd.xml / cpd.xml), which can be consumed by other tools, but no HTML reports anymore. HTML reports are only created by the report goals, e.g. during site generation. Shared code for reports and checks: - PmdServiceExecutor creates the empty result if there are no files to process and logs the PMD version (analogous to CPD). Both executors copy the XML into the report output directory with REPLACE_EXISTING. - New SourceFileCollector: determination of the files to process, extracted from AbstractPmdReport. - New PmdRequestSupport: resolution of rulesets, auxclasspath, java runtime classes and number of threads, extracted from PmdReport. Intentionally not a singleton, as the ResourceManager is configured with project specific search paths. Check goals: - New base class AbstractPmdAnalysisMojo with the common analysis parameters (incl. encoding and jdkToolchain), AbstractPmdViolationCheckMojo extends it. - check and cpd-check: removed @Execute fork, executors are injected, added the PMD/CPD analysis parameters. check requires dependency resolution scope TEST. - The XML result file is written before the evaluation, so it exists even if the build fails because of violations. - aggregate-cpd-check no longer forks. aggregate-pmd-check still forks the test-compile phase (needed for type resolution), but no report goal. - Warn if format "html" is configured for the check goals. Report goals: - PmdReport, CpdReport and the aggregator reports use the shared components. Tests and documentation: - Existing check mojo tests mock the executors via @Provides, so they only verify the evaluation of the provided XML files. - New ViolationCheckMojoAnalysisTest with real analysis: XML is created on failure and without source files, no site directory is created. - New IT GH-189-check-without-report: no fork, PMD executed only once, XML present, no HTML. - IT MPMD-304-toolchain-support now expects no HTML reports from check. - Updated usage, goals overview, upgrade notes for 3.29.0, FAQ and the javadoc of the report goals. closes #189 PR was created with help of AI, but also checked manually in a separate project. --- To make clear that you license your contribution under the [Apache License Version 2.0, January 2004](https://www.apache.org/licenses/LICENSE-2.0) check one of the following: - [ ] I hereby declare this contribution to be licensed under the [Apache License Version 2.0, January 2004](https://www.apache.org/licenses/LICENSE-2.0) - [x] I hereby declare that I have filed an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
