如何包装Gradle多模块弹簧启动应用程序以用于其他项目?
我有一个带有多个模块的Gradle Spring Boot项目,并希望将其构建为JAR文件,以便我可以重复使用其他项目中不同模块的方法。
我在根路径的build.gradle
中使用了java-library
插件,并将其作为jar包装。但是,当我将其导入其他应用程序作为依赖项时,无法访问boot-inf/libs
下的每个模块的JAR文件,而我称之为的方法无法找到。
有什么办法可以使每个模块可重复使用其他应用程序?
I have a gradle spring boot project with multiple modules and want to build it as a jar file so that I can reuse the methods from different modules in other projects.
I used java-library
plugin in the build.gradle
of the root path and packaged it as a jar. But when I imported it into my other applications as a dependency, the jar files of each module under BOOT-INF/libs
are not accessible and the methods I called can't be located.
Is there any way I can make each module reusable for other applications?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以将项目作为模块管理,并在导入时使用它们,
请检查以下链接:
https://stackoverflow.com/a/69660601/7505687
> @componentscan
You can manage projects as module and use them on importing
Check this link:
https://stackoverflow.com/a/69660601/7505687
If you need to share spring boot beans ammong them use
@ComponentScan