-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Document placeholder and Ant-style pattern support for @ComponentScan
#35491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document placeholder and Ant-style pattern support for @ComponentScan
#35491
Conversation
…onentscan - JavaDoc: clarify that basePackages/value resolve ${…} via Environment and accept Ant-style package patterns (e.g., com.example.**); note patterns don’t apply to basePackageClasses. - Reference: add “Property placeholders and Ant-style patterns” subsection in classpath-scanning.adoc with Java/Kotlin + properties examples. Closes spring-projectsgh-35288 Signed-off-by: Byeong-Uk Park <114344042+Rockernun@users.noreply.github.com>
${…}
placeholders & Ant-style patterns for @ComponentScan
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a few notes, but I am approving this PR as-is, since I have made the necessary changes locally on my machine.
`exports` declaration in your `module-info` descriptor). | ||
==== | ||
|
||
==== Property placeholders and Ant-style patterns |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please note that this breaks the build.
[16:49:49.179] WARN (asciidoctor): section title out of sequence: expected level 2, got level 3
file: /XXX/spring-framework/framework-docs/modules/ROOT/pages/core/beans/classpath-scanning.adoc:335
However, I have addressed this locally, thus there is no need to update this PR.
|
||
NOTE: Ant-style patterns do not apply to `basePackageClasses`, which accepts concrete | ||
classes and derives packages from those classes. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI: the following paragraph and note belong to the previous section about XML configuration.
However, I have addressed this locally, thus there is no need to update this PR.
* <p><strong>Note:</strong> Ant-style patterns are <em>not</em> applicable to | ||
* {@link #basePackageClasses()}, which accepts concrete classes for type-safe | ||
* package selection. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there is any need to point this out, since one can only supply Class
references via the basePackageClasses
attribute.
Thus, I have removed this and other such text locally.
`exports` declaration in your `module-info` descriptor). | ||
==== | ||
|
||
==== Property placeholders and Ant-style patterns |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For future reference, please note that we do our best to introduce custom anchors that align with other anchors used in the same file.
For example, I've added the following that I will apply after merging this PR.
[[beans-scanning-placeholders-and-patterns]]
${…}
placeholders & Ant-style patterns for @ComponentScan
@ComponentScan
Overview
@ComponentScan(basePackages)
already supports:However, this behavior wasn’t explicitly called out in the JavaDoc or the reference docs, making it easy to miss. This PR documents those capabilities and clarifies where pattern support applies.
JavaDoc: clarify that basePackages/value resolve ${…} via the Environment and support Ant-style package patterns (e.g., com.example.**); note patterns do not apply to basePackageClasses.
Reference docs: add a short subsection in classpath-scanning.adoc with Java/Kotlin + properties examples.
Related Issues
@ComponentScan(basePackages)
property placeholder and ant-path support #35288