I have this class to start spring -cloud configuration server. This is spring-boot app.
@SpringBootApplication @EnableConfigServer @EnableDiscoveryClient public class ConfigServerApplication { public static void main( String[] args ) { SpringApplication.run( ConfigServerApplication.class, args ); } }
The application works fine, and all my unit tests are fine. However, in our bamboo pipeline, he will begin the sonar process for code analysis. We continue to receive these minor warnings indicating the following:
Utility classes should not have a public constructor
I know this is a small problem, but I was instructed to remove them from our code.
Ideally, you would mark the final class and provide a private constructor, or therefore all search queries as a solution. However, the Spring Configuration class cannot be final and cannot have a private constructor.
Any ideas how to solve this problem?
source share