简体   繁体   中英

How to configure a Maven project to generate a different jar for each implementation of an interface

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.

使用一个多模块项目,一个common模块和四个模块用于不同的实现。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM