diff --git a/docs/CONFIGURATION.md b/docs/CONFIGURATION.md index e6f11926..cba0f1c5 100644 --- a/docs/CONFIGURATION.md +++ b/docs/CONFIGURATION.md @@ -12,6 +12,7 @@ Simple-builders supports fine-grained configuration through the `@SimpleBuilder. - [Maven Configuration](#maven-configuration) - [Gradle Configuration](#gradle-configuration) - [IntelliJ IDEA Configuration](#intellij-idea-configuration) + - [Command Line (-D)](#command-line--d) - [Configuration Options](#configuration-options) - [Field Setter Generation](#field-setter-generation) - [Conditional Logic](#conditional-logic) @@ -221,6 +222,13 @@ compileJava { -Asimplebuilder.generateFieldSupplier=true -Asimplebuilder.builderAccess=PUBLIC ``` +### Command Line (-D) + +Maven and Gradle accept the options as JVM system properties without a build-file change, for example `mvn compile -Dsimplebuilder.generateJavaDoc=DISABLED` or `gradle compileJava -Dsimplebuilder.generateJavaDoc=DISABLED`. +The precedence is `@SimpleBuilder.Options` > `-D` system property > `-A` compiler argument > default. +The system property wins so you can override options configured in the build file from the command line without editing it. +This relies on javac running in the build tool's JVM (the default for Maven and Gradle); use the `-A` form for forked compilation (`true` / `options.fork = true`) and IDE builds. Gradle also accepts `systemProp.simplebuilder.