I have a project in IntellijIDEA which was created with Maven. I then specified a set of dependencies and external repositories in the Pom.xml file.
The project builds
Go to File > Settings > Build, Execution, Deployment > Build Tools > Maven and check the Maven home directory. This should be the same maven installation used for command line