-
Notifications
You must be signed in to change notification settings - Fork 38.9k
Closed
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)status: declinedA suggestion or change that we don't feel we should currently applyA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancementA general enhancement
Description
Chris Beams opened SPR-6310 and commented
Much like Spring's TestContext framework and its @ContextConfiguration annotation, processing @Configuration classes should support relative paths and loading resources by convention when using @ImportXml:
- Relative paths:
package com.biz.app;
@Configuration
@ImportResource("Foo.xml")
public class AppConfig { ... }It is assumed that Foo.xml resides in com.biz.app, the same package in which AppConfig is declared.
- Import by convention:
package com.biz.app;
@Configuration
@ImportResource
public class AppConfig { ... }It is assumed that classpath:/com/biz/app/AppConfig-context.xml exists.
See testImportXmlWithRelativePath() and testImportXmlByConvention(), which are both currently @Ignore'd in org.springframework.context.annotation.configuration.ImportXmlTests. See also TODO in ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsFromXml()
Issue Links:
- Support @ImportResource within @Configuration classes [SPR-6158] #10826 Support
@ImportResourcewithin@Configurationclasses ("depends on") - Relative imports in @Configuration classes [SPR-8356] #13003 Relative imports in
@Configurationclasses - Preserve 'reader' attribute in @ImportResource hierarchies [SPR-6327] #10993 Preserve 'reader' attribute in
@ImportResourcehierarchies
Referenced from: commits ae11387
1 votes, 3 watchers
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)status: declinedA suggestion or change that we don't feel we should currently applyA suggestion or change that we don't feel we should currently applytype: enhancementA general enhancementA general enhancement