apache / apache/maven-mvnd

Log warning splits on multiple lines

Open
#1,465 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
3.5k
Forks
250
Avg merge
16h 22m
Merged PRs (30d)
36

Description

### Affected version

1.0.3

### Bug description

Hello team.
If I run:
```
mvn help:evaluate -Dexpression=project.artifactId
...
[WARNING] This build will only read from the build cache, since the clean lifecycle is not part of the build invocation.
[WARNING] The POM for org.apache.camel:camel-package-maven-plugin:jar:4.17.0-SNAPSHOT is missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for org.apache.camel:camel-package-maven-plugin:4.17.0-SNAPSHOT: Plugin org.apache.camel:camel-package-maven-plugin:4.17.0-SNAPSHOT or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.apache.camel:camel-package-maven-plugin:jar:4.17.0-SNAPSHOT (absent): Could not find artifact org.apache.camel:camel-package-maven-plugin:jar:4.17.0-SNAPSHOT
```
the warning is shown in a single line. However, when running in `mvnd`, the log is splitted:
```
mvnd help:evaluate -Dexpression=project.artifactId
...
[WARNING] The POM for org.apache.camel:camel-package-maven-plugin:jar:4.17.0-SNAPSHOT is missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for org.apache.camel:camel-package-maven-plugin:4.17.0-SNAPSHOT: Plugin org.apache.camel:camel-package-maven-plugin:4.17.0-SNAPSHOT or one of its dependencies could not be resolved:
Could not find artifact org.apache.camel:camel-package-maven-plugin:jar:4.17.0-SNAPSHOT
[WARNING] The POM for org.apache.camel:camel-repackager-maven-plugin:jar:4.17.0-SNAPSHOT is missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for org.apache.camel:camel-repackager-maven-plugin:4.17.0-SNAPSHOT: Plugin org.apache.camel:camel-repackager-maven-plugin:4.17.0-SNAPSHOT or one of its dependencies could not be resolved:
Could not find artifact org.apache.camel:camel-repackager-maven-plugin:jar:4.17.0-SNAPSHOT
```
Considering the the tool can be used by script and CI, it would be convenient to keep the log output as expected, above all maintaining the same line or at least adding the line header (in this case, `[WARNING]`).

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the behavior with `mvnd help:evaluate -Dexpression=project.artifactId` and compare its warning output with the equivalent `mvn` command shown in the issue. Trace the logging path responsible for multi-line warnings; done means warnings remain on one line or each continuation line carries the `[WARNING]` header.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.