SonarQube rule: “Using command line arguments is security-sensitive” in Spring Boot application

后端 未结 3 2173
南旧
南旧 2021-01-01 10:57

SonarQube is just showing a Critical security issue in the very basic Spring Boot application. In the main method.

@SpringBootApplication
public class Applic         


        
3条回答
  •  情歌与酒
    2021-01-01 11:32

    If you are not using any command-line arguments ,then you could avoid mentioning the args parameter in the run method .Like the below code.

    @SpringBootApplication
    public class Application {
    
        public static void main(String[] args) {
            SpringApplication.run(Application.class);
        }
    
    }
    

    This will remove sonarqube hotspot issue.

提交回复
热议问题