From ab8a0526b99c85df89e4a672f0390f358c6bc9ef Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sat, 5 Sep 2026 06:45:13 +0000 Subject: [PATCH 1/3] feat: fall back to -D system properties for compiler options (#275) Co-Authored-By: Andreas Igel --- docs/CONFIGURATION.md | 9 +++- docs/DEBUG_LOGGING.md | 4 +- .../processing/CompilerArgumentsReader.java | 11 ++++- .../CompilerArgumentsReaderTest.java | 41 +++++++++++++++++++ 4 files changed, 61 insertions(+), 4 deletions(-) diff --git a/docs/CONFIGURATION.md b/docs/CONFIGURATION.md index e6f11926..f36262ff 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 (Maven -D)](#command-line-maven--d) - [Configuration Options](#configuration-options) - [Field Setter Generation](#field-setter-generation) - [Conditional Logic](#conditional-logic) @@ -221,6 +222,12 @@ compileJava { -Asimplebuilder.generateFieldSupplier=true -Asimplebuilder.builderAccess=PUBLIC ``` +### Command Line (Maven -D) + +Maven supports compiler options without a `pom.xml` change, for example: `mvn compile -Dsimplebuilder.generateJavaDoc=DISABLED`. +The precedence is `@SimpleBuilder.Options` > `-A` compiler argument > `-D` system property > default. +This relies on javac running inside the Maven JVM (the default); use the `-A` form for Gradle, IDE builds, and forked compilation. + ## Configuration Options All options use `OptionState` enum with values: `ENABLED`, `DISABLED`, or `UNSET` (uses default/compiler arg). @@ -1264,7 +1271,7 @@ Or in compiler options: ### Compiler Options Not Working -1. **Check option names**: Ensure you're using the full option name (e.g., `-Asimplebuilder.generateFieldSupplier`) +1. **Check option names**: Ensure you're using the full option name (e.g., `-Asimplebuilder.generateFieldSupplier`); Maven also supports the `-Dsimplebuilder.