You have to right-click on the pom.xml file, go down to Maven, and then select Sync Project. It should work afterwards, or you might see a notification about vulnerable dependencies.