Use Tools | Create Command-line Launcher, then run it from the Terminal.
imported a maven project with below command:
idea pom.xml <---- This is the Command line tool provided by Intellij guys
If you use spring boot and want to open from the terminal maven project its easy.