Run jar with parameters in gradle

后端 未结 2 969
半阙折子戏
半阙折子戏 2021-02-07 04:54

I want to run a jar file with parameters located at C:/Users/nwuser/FitNesse/fitnesse-standalone.jar in my gradle script. I know how to do it without parameters:



        
2条回答
  •  情深已故
    2021-02-07 05:02

    args is an array, so simply supply your arguments as such:

    task runJar(dependsOn:jar) << {
      javaexec { 
        main="-jar";
        args = [
                "C:/Users/nwuser/FitNesse/fitnesse-standalone.jar",
                "-c",
                "FrontPage?suite&format=text"
               ]
      } 
    }
    

提交回复
热议问题