[SHL-106] Support JavaConfig configuration of Application Context used for Spring Shell plugins Created: 08/Aug/13  Updated: 19/Mar/15

Status: Open
Project: Spring Shell
Component/s: None
Affects Version/s: 1.0.0
Fix Version/s: 2.0 M1

Type: New Feature Priority: Major
Reporter: Daniel Ling Assignee: Unassigned
Resolution: Unresolved Votes: 4
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


Passing a @Configuration annotated class to the Bootstrap constructor should be sufficient to support JavaConfig configuration of the Application Context used for Spring Shell plugins.

Comment by Daniel Ling [ 08/Aug/13 ]

Sent a pull request with code to support this: https://github.com/SpringSource/spring-shell/pull/14

Comment by Mark Pollack [ 01/Apr/14 ]

I believe this can be implemented in a much more simple way by allowing you to pass in either a string or Class refs to

ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(ctx);
scanner.scan("org.springframework.shell.commands", "org.springframework.shell.converters", "org.springframework.shell.plugin.support");

as compared to the approach in the PR that duplicates a fair bit of code and brings in AnnotatedBeanDefinitionReader and not piggybacking on top of

Also, it shouldn't be either/or, both locations 'JavaConfig' as well as classpath*:/META-INF/spring/spring-shell-plugin.xml should be able to contribute commands simultaneously.

Comment by Robin Howlett [ 16/Dec/14 ]

Created SHL-106: Java Configuration support #66 pull request to add support for Java Configuration using ClassPathBeanDefinitionScanner, permitting mixing XML and Java Configuration support for Commands.

Generated at Sat Oct 19 12:02:02 UTC 2019 using Jira 7.13.8#713008-sha1:1606a5c1e7006e1ab135aac81f7a9566b2dbc3a6.