eclipse 如果它在 jar 文件中,则基于 Spring Annotation 的控制器不起作用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1242656/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 13:57:22  来源:igfitidea点击:

Spring Annotation-based controllers not working if it is inside jar file

javaeclipsespring

提问by Arun P Johny

I've some annotation-based controller inside a sub module. These modules are deployed as jar files.

我在子模块中有一些基于注释的控制器。这些模块部署为 jar 文件。

The annotation-based controllers from the jar file is not getting loaded to the spring configuration.

jar 文件中基于注释的控制器没有加载到 spring 配置中。

I'm manually exporting the jar file using the export utility in eclipse.

我正在使用 eclipse 中的导出实用程序手动导出 jar 文件。

Did any one faced this problem?

有没有人遇到过这个问题?

回答by Arun P Johny

When you export the jar file using the export utility in eclipse there is a option called Add directory entries. Check this option and export the jar file, this will solve the problem.

在 Eclipse 中使用导出实用程序导出 jar 文件时,有一个名为添加目录条目的选项。选中此选项并导出 jar 文件,这将解决问题。