Deprecated Property Scanner
Scans for deprecated @ConditionalOnProperty and @ConfigurationProperties annotations during application startup.
This component analyzes classes in configured packages to detect usage of deprecated properties in @ConditionalOnProperty and @ConfigurationProperties annotations, issuing warnings through the SimpleDeprecatedConfigWarner. Uses SmartInitializingSingleton to ensure all beans are fully available before scanning.
Conditional Bean Loading Scenarios
This scanner works with conditionally loaded beans based on migration configuration:
Scenario 1: Iteration 0 Default (Scanning Disabled)
# Default behavior - no scanning property set
# embabel.agent.platform.migration.scanning.enabled=false (implicit)
embabel.agent.platform.migration.warnings.enabled=true (default via matchIfMissing=true)
Bean State: scanningConfig = null
, propertyWarner = available
Behavior: Scanner logs "scanning disabled", no package scanning occurs Use Case: Iteration 0 production - warnings work, scanning deferred to Iteration 1
Scenario 2: Warnings Explicitly Disabled
embabel.agent.platform.migration.warnings.enabled=false
embabel.agent.platform.migration.scanning.enabled=false
Bean State: scanningConfig = null
, propertyWarner = null
Behavior: Scanner logs "migration system completely disabled" Use Case: Production environments that want to disable all migration detection
Scenario 3: Full Migration Detection (Iteration 1+)
embabel.agent.platform.migration.warnings.enabled=true
embabel.agent.platform.migration.scanning.enabled=true
Bean State: scanningConfig = available
, propertyWarner = available
Behavior: Full package scanning with conditional annotation detection Use Case: Iteration 1+ production - complete migration detection system active
Scenario 4: Warnings Only (Partial Detection)
embabel.agent.platform.migration.warnings.enabled=true
# embabel.agent.platform.migration.scanning.enabled=false (default)
Bean State: scanningConfig = null
, propertyWarner = available
Behavior: Property warnings work, but no @ConditionalOnProperty scanning Use Case: Users want property warnings but not bytecode scanning overhead
Rule Invocation Flow (When Fully Enabled)
The migration rules are automatically invoked during Spring application startup whenever deprecated conditional properties are detected in scanned classes:
Example Scenarios:
@ConditionalOnProperty Detection:
Scenario A: Direct Property -
@ConditionalOnProperty("embabel.anthropic.max-attempts")
Scenario B: Prefix + Name -
@ConditionalOnProperty(name = "max-attempts", prefix = "embabel.anthropic")
Scenario C: Prefix Only -
@ConditionalOnProperty(prefix = "embabel.autonomy")
@ConfigurationProperties Detection:
Scenario D: Deprecated Prefix -
@ConfigurationProperties(prefix = "embabel.autonomy")
Scenario E: Legacy Platform -
@ConfigurationProperties("embabel.agent-platform.ranking")
Spring startup →
afterSingletonsInstantiated()
called after all beans initializedBean availability check → Verifies both scanning config and property warner are available
Package scanning → Finds classes in configured include packages (internal + external)
Annotation detection → Finds
@ConditionalOnProperty
and@ConfigurationProperties
annotations on classesProperty extraction → Extracts property names from all annotation patterns:
@ConditionalOnProperty Direct:
"embabel.anthropic.max-attempts"
@ConditionalOnProperty Prefix+Name: Combines to
"embabel.anthropic.max-attempts"
@ConditionalOnProperty Prefix-Only:
"embabel.autonomy"
@ConfigurationProperties Prefix:
"embabel.autonomy"
Deprecation check →
isDeprecatedProperty()
returnstrue
for all deprecated patternsWarning generation →
getRecommendedProperty()
called with deprecated property nameTransformation → Explicit mapping lookup returns new property name
Warning issued → Logger warns about deprecated usage with recommended replacement property
See also
for rule definition structure
for scanning configuration options
for warning output format
Constructors
Functions
Adds a new property migration rule at runtime. Useful for extending migration support without code changes.
Performs conditional property scanning after all singletons are initialized.
Gets all currently configured migration rules.