Skip to content

[core] Non-XML output breaks XML-based CLI integrations #1036

@SCWells72

Description

@SCWells72

Affects PMD Version:
6.2.0

Rule:
All

Description:
It looks like in recent builds when you specify -f xml, some non-XML information is written to stdout causing XML-based integrations such as my IDE (Illuminated Cloud) to break. For example, here's he result of an otherwise successful execution:

This analysis could be faster, please consider using Incremental Analysis: https://pmd.github.io/pmd-6.2.0/pmd_userdocs_getting_started.html#incremental-analysis …<?xml version="1.0" encoding="UTF-8"?><pmd ...>...</pmd>

When the CLI is run for structured output, nothing but the structured output should be emitted to stdout/stderr. Otherwise parsing of the contents of the streams will fail unless some form of scrubbing/pre-processing is performed by every integrating client.

Running PMD through:

While found through the integration with Illuminated Cloud, this is easily reproducible via the CLI.

Metadata

Metadata

Assignees

Labels

a:bugPMD crashes or fails to analyse a file.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions