Maven: How to run a .java file from command line passing arguments

前端 未结 3 1206
一生所求
一生所求 2020-12-02 05:49

I have the following problem. I would like to run mvn from command line for a Main.java file. Main.java accepts a parameter. H

3条回答
  •  既然无缘
    2020-12-02 06:27

    In addition to running it with mvn exec:java, you can also run it with mvn exec:exec

    mvn exec:exec -Dexec.executable="java" -Dexec.args="-classpath %classpath your.package.MainClass"
    

提交回复
热议问题