Skip to content

Fix #11199: Maven 4.0.0-rc-4 ignores defaultLogLevel#11219

Merged
gnodet merged 1 commit intoapache:masterfrom
gnodet:fix-gh-11199-logger-off-level
Oct 8, 2025
Merged

Fix #11199: Maven 4.0.0-rc-4 ignores defaultLogLevel#11219
gnodet merged 1 commit intoapache:masterfrom
gnodet:fix-gh-11199-logger-off-level

Conversation

@gnodet
Copy link
Contributor

@gnodet gnodet commented Oct 8, 2025

The issue was that LookupInvoker always called setRootLoggerLevel() with INFO level even when no CLI options were specified, overriding configuration file settings by setting a system property.

Changes:

  • LookupInvoker.prepareLogging(): Only call setRootLoggerLevel() when CLI options (-X, -q) are explicitly specified, allowing config file to work
  • MavenSimpleConfiguration: Improved switch statement clarity
  • Added comprehensive unit tests for both logging configuration and CLI behavior

This ensures that maven.logger.defaultLogLevel=off in configuration files is properly respected when no CLI logging options are provided, while maintaining backward compatibility with CLI option overrides.

Fixes #11199

@gnodet gnodet requested a review from cstamas October 8, 2025 14:50
@gnodet gnodet added bug Something isn't working backport-to-4.0.x labels Oct 8, 2025
The issue was that LookupInvoker always called setRootLoggerLevel() with
INFO level even when no CLI options were specified, overriding configuration
file settings by setting a system property.

Changes:
- LookupInvoker.prepareLogging(): Only call setRootLoggerLevel() when CLI
  options (-X, -q) are explicitly specified, allowing config file to work
- MavenSimpleConfiguration: Improved switch statement clarity
- Added comprehensive unit tests for both logging configuration and CLI behavior

This ensures that maven.logger.defaultLogLevel=off in configuration files
is properly respected when no CLI logging options are provided, while
maintaining backward compatibility with CLI option overrides.

Fixes apache#11199
@gnodet gnodet force-pushed the fix-gh-11199-logger-off-level branch from da005bb to 782abbd Compare October 8, 2025 15:28
@gnodet gnodet merged commit 49d7f01 into apache:master Oct 8, 2025
37 of 38 checks passed
@github-actions github-actions bot added this to the 4.1.0 milestone Oct 8, 2025
@gnodet
Copy link
Contributor Author

gnodet commented Oct 8, 2025

💚 All backports created successfully

Status Branch Result
maven-4.0.x

Questions ?

Please refer to the Backport tool documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-to-4.0.x bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Maven 4.0.0-rc-4 ignores defaultLogLevel

2 participants