我想将 Spring Shell 集成到 Spring Boot 应用程序中。我能够执行官方git-repo中的示例。但是,当将示例代码迁移到与此代码非常相似的我自己的项目时,我的个人 shell 未显示或不可用。相反,显示的默认 Spring Shell 飞溅是可用的:
<SpringShell ASCII-Art>
1.1.0.RELEASE
Welcome to Spring Shell. For assistance press or type "hint" then hit ENTER
spring-shell>
编译没有错误,但没有使用单个样本 @component 标记的类。所有注释均已正确设置。存在外部标准装载机。我没有在 IDE 中执行代码。
尽管文档(第 3.5 章)告诉我们,据我所知,组件是自动收集的。
所以我的问题或多或少是如何设置比这更好的用法:
public class Main {
public static void main(String[] args) throws Exception {
Bootstrap.main(args);
}
}
并击败默认的飞溅!