Skip to content

Is there a way to execute only some packages in SpringBoot?

I have a use case where I have a lot of services running in the same code base but they are in different packages. So, whenever I start SpringBoot all those services start. Is there a way I can specify SpringBoot to start the code in a particular package? Thanks in advance


you can use component scan annotation in main class, which will scan only the packages mentioned

 @ComponentScan(basePackages = "name of specific package")