Run intellij idea project from command line

2019-07-21 10:38发布

问题:

I have quite massive project which was developed in intellij Idea. Now I have to be able to run it from command line, but there are too many libraries including maven dependencies are used.
Is there a way to get command line that is used by intellij idea when it runs a project?

回答1:

If you use maven you can do this:

mvn install
mvn exec:java -Dexec.mainClass="com.module.Main" -Dexec.classpathScope=runtime