In general, configuration required to run a build should be encoded in the build itself. Once the dependencies have been configured, they will be downloaded from repositories to your local machine. When the Gradle daemon is enabled, these are the options used to start its JVM. This is because bootRun in your build.gradle configures the system properties. The version of Gradle is between 7.0 and 7.1.1 inclusively. There's been a great deal of discussion over the years about passing command line arguments to tests with Gradle (IE: -Dfoo=bar). 4.5/5 (2,847 Views . First, let's use the application plugin in our build.gradle:. For example: ./gradlew <task-name> -PmyPropName1=myPropValue1 -PmyPropName2=myPropValue2. Download and installation If you need a workaround, you should be able to encode it inside your single settings file (e.g. Default value: build How to pass command-line arguments to main class in gradle? Gradle command Line arguments. The above tasks equates to running the following command in your terminal: adb shell settings put global sysui_demo_allowed 1 End. Gradle build and release task - Azure Pipelines | Microsoft Docs We can use short command-line arguments -port=8085 instead of -server.port=8085 by using a placeholder in our application.properties : server.port= $ {port:8080} Command-line arguments take precedence over application.properties values. See Gradle Build Script Basics. Executing commands from Gradle - chRyNaN Codes With this option we run Gradle in offline mode to indicate we are not connected to network resources like the internet. A list of task names should be separated by spaces and can be taken from gradlew tasks issued from a command prompt. See Gradle Command Line. Verify your installation. Use this field as the Gradle command line to specify options for Gradle tasks. The solutions generally boil down to two approaches: 1. Gradle 4.9 introduced the --args parameter to bootRun, which I can use easily from the command-line, but how do I use this from a Run/Debug configuration in Intellij 2018?. This corresponds to the gradle :subproject:build command. Like so:./gradlew test -Dgrails.env=dev -D<yourVarName>=<yourValue> See the gradle command line documentation of -D. To access it in the tests, you need to propagate it in your build.gradle file. The Gradle command-line parser will add all non-option arguments as tasks to be executed to the build. Output will be limited to dependencies outside these scopes (overrides include). Gradle command Line arguments. 1) On the command line when calling Gradle using -P. When you run a Gradle command you can pass as many -PpropertyName=propertyValue flags as you like.