dmf*_*rey 7 spring spring-boot spring-java-config sonarqube spring-cloud
我有这个类来启动spring-cloud配置服务器.这是一个spring-boot应用程序.
@SpringBootApplication
@EnableConfigServer
@EnableDiscoveryClient
public class ConfigServerApplication {
public static void main( String[] args ) {
SpringApplication.run( ConfigServerApplication.class, args );
}
}
Run Code Online (Sandbox Code Playgroud)
应用程序运行正常,我所有的单元测试都很好.但是,在我们的竹子管道中,它将初始化一个声纳过程来分析代码.我们不断收到这些小警告,表明以下内容:
Utility classes should not have a public constructor
Run Code Online (Sandbox Code Playgroud)
我知道这是一个小问题,但我的任务是从代码中删除这些.
理想情况下,您可以将类标记为final并提供私有构造函数,或者所有搜索都提供解决方案.但是,Spring Configuration类不能成为final,也不能有私有构造函数.
任何想法如何解决这个问题?
| 归档时间: |
|
| 查看次数: |
5485 次 |
| 最近记录: |