Improve source root modification warning message #11105
Merged
+17
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR improves the warning message for deprecated source root collection modifications to address concerns raised in #11089.
Changes Made
More specific method recommendations: Instead of generic "add/remove methods", now shows exact method names:
compileSourceRoots: "Use MavenProject.addCompileSourceRoot()/removeCompileSourceRoot() methods instead"testCompileSourceRoots: "Use MavenProject.addTestCompileSourceRoot()/removeTestCompileSourceRoot() methods instead"Clearer language: Changed "Direct modification of" to "Plugin is modifying" to make it clearer what's happening
More concise messaging: Removed redundant phrases while keeping essential information
Better debugging information: Improved the debug stack trace message description
Ecosystem health: Encourages reporting issues to plugin maintainers to help prepare the Maven ecosystem for 4.0.0
Preserved helpful configuration guidance: Kept the valuable information about where users can set the disable property
Before and After
Before:
After:
Addresses Issues Raised in #11089
The changes maintain backward compatibility while making the warning message much more helpful and less confusing for both end users and plugin developers.
Fixes #11089
Pull Request opened by Augment Code with guidance from the PR author