I had opened the parent folder in Intelli-J. After opening the child folder that has the POM file, it worked.