How melix/jdoctor works
Project type and purpose
• This is an open-source, multi-module Java library (“JDoctor”) whose goal is to help library authors and application developers model and render rich, actionable error/help messages.
• Key modules:
• jdoctor-core: defines the Problem/Solution model (interfaces and base classes)
• jdoctor-utils: builds on core; supplies builders and a simple text renderer
• jdoctor-bom: a Gradle “Bill of Materials” to align versions of JDoctor artifacts
• jdoctor-build-logic: custom Gradle/Kotlin build plugin(s) to simplify publishing
File structure
• Top-level Gradle settings, version catalogs, and wrapper files govern the build
• Four project directories under root:
• jdoctor-core
• jdoctor-utils
• jdoctor-bom
• jdoctor-build-logic
• Each module has its own build.gradle.kts and src/ structure
• Core and utils have both production (src/main/java[11]) and test code (src/test/groovy, src/testFixtures)
• gradle/libs.versions.toml & gradle.properties store shared version info
• Custom Gradle plugin code lives under jdoctor-build-logic/src/main/kotlin
README for additional insights
• The README calls out the three published modules (core, utils, bom) and encourages consumers to pick and choose
• It emphasizes that rendering is the consumer’s responsibility, with utils providing a convenience renderer
a. Main components:
• Module: jdoctor-core (model)
• Module: jdoctor-utils (builders + renderers)
• Module: jdoctor-bom (version alignment)
• Module: jdoctor-build-logic (Gradle plugins for publishing)
• Consumers (external apps/libraries that depend on jdoctor artifacts)
• Gradle build system, Maven Central (publishing target)
b. Relationships & interactions:
• jdoctor-utils → depends on → jdoctor-core
• jdoctor-build-logic → applies to → root build and subprojects → publishes → core, utils, bom
• jdoctor-bom → has no code dependency, only a platform/BOM POM published for alignment
• Consumers → import → jdoctor-core and/or jdoctor-utils and/or BOM
c. Architectural patterns & design principles:
• Layered modular design – separation of “model” (core) from “rendering”/“builders” (utils)
• Gradle platform (bom) for consistent version management
• Custom Gradle plugin encapsulates publishing/publishing logic (DRY build logic)
• Test fixtures and Java 11–specific code kept under dedicated source roots
d. Key technologies & frameworks:
• Java 8+ and Java 11 modules (multi-release)
• Gradle Kotlin DSL (build.gradle.kts)
• Version catalogs (libs.versions.toml)
• Groovy for tests
• Maven Central publishing via Gradle