如何配置Maven项目以生成每个接口的每个实现的JAR
我必须构建一个小型Springboot应用程序,其中控制器类使用接口。该接口由四个不同类实现。这四个实现代表了该应用程序将运行的四个不同平台,并根据其运行的不同平台具有依赖关系。在任何一个平台中,将仅使用其中一个实现。
因此,我希望能够将应用程序作为四个单独的罐子打包,每个罐子包含一个实现(因此我可以基于平台部署该应用程序,只有一个实现)。我不知道该如何工作。任何帮助都将受到赞赏。关于我将如何拥有该项目的文件夹结构的任何提示也将有很大帮助。
I have to build a small Springboot application where the Controller class uses an interface. The interface is implemented by four different classes. These four implementations represent four different platforms the application will run in and have dependencies based on the different platforms they run on. In any one platform, only one of the implementations will be used.
Therefore, I want to be able to package the application as four separate jars, each of which contains one implementation (so I can deploy the app based on the platform with only one implementation). I have no idea how to get this working. Any help is appreciated. Any hints on how I would have the folder structure of the project as well would help a lot too.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用一个多模型项目,其中一个
common
模块和四个模块用于不同的实现。Use a multi-module project, with one
common
module and four modules for the different implementations.