In Gradle 7, how to disable parallel compilation using command line option "-Porg.gradle.parallel=false"?

241 Views Asked by At

In gradle document, -Pxxx=yyy commandline option is claimed to be able to override build property. So I want to override the property "org.gradle.parallel", which is already defined in the properties file and controls parallel execution.

When I run the following command:

$ ./gradlew test "-Porg.gradle.parallel=false"

The test execution is still parallel. How could this happen?

1

There are 1 best solutions below

0
On BEST ANSWER

The correct command is:

$ ./gradlew test "-Dorg.gradle.parallel=false"

And apparently -P won't apply to built-in properties