Just reload pom.xml file after adding spring boot security dependency if you are using IntelliJ IDE and restart/rerun the application.