Issue
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.
Solution
Use a multi-module project, with one common
module and four modules for the different implementations.
Answered By - J Fabian Meier
Answer Checked By - David Marino (JavaFixing Volunteer)