Uploaded image for project: 'Spring Shell'
  1. Spring Shell
  2. SHL-106

Support JavaConfig configuration of Application Context used for Spring Shell plugins

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.0.0
    • Fix Version/s: 2.0 M1
    • Component/s: None
    • Labels:
      None

      Description

      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.

        Activity

        Hide
        dling Daniel Ling added a comment -

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

        Show
        dling Daniel Ling added a comment - Sent a pull request with code to support this: https://github.com/SpringSource/spring-shell/pull/14
        Hide
        mark.pollack Mark Pollack added a comment -

        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
        ClassPathBeanDefinitionScanner.

        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.

        Show
        mark.pollack Mark Pollack added a comment - 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 ClassPathBeanDefinitionScanner. 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.
        Hide
        robinhowlett Robin Howlett added a comment - - edited

        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.

        Show
        robinhowlett Robin Howlett added a comment - - edited 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.

          People

          • Assignee:
            Unassigned
            Reporter:
            dling Daniel Ling
          • Votes:
            4 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated: