← All tasks
javaknowm/XChange #5302Not a task: already works

[build] Lombok annotation processing silently skipped under maven-compiler-plugin 3.15.0

envgap__knowm__XChange-5302

01 / FAILURE SIGNATURE

As reported upstream

[ERROR] /xchange-core/.../SomeClass.java:[NN,M] cannot find symbol
Not a benchmark task.
  • The project already builds and runs before the fix, so there is nothing to repair.

02 / ENVIRONMENT RECIPE

Base commit
57c7567a36f0b32d21d466a7bca799646cb7d543
Manifest
pom.xml
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

knowm/XChange #5302 · read the original issue
## Problem

Lombok no longer runs during compilation — `@Data` / `@Builder` / `@Getter` etc. generate nothing, so every consumer of a Lombok-annotated class fails to compile with "cannot find symbol" for `getXxx()` / `setXxx()` / `builder()`.

```
[ERROR] /xchange-core/.../SomeClass.java:[NN,M] cannot find symbol
  symbol:   method getFoo()
  location: variable instance of type org.knowm.xchange.SomeData
```

### Reproduce

```
mvn clean compile
```

Fails on JDK 21+ (where javac requires `-proc` to be explicit) and emits a deprecation warning on JDK 17 ("Annotation processing is enabled because one or more processors were found on the class path").

### Cause

The root pom declares Lombok only as a `provided` dependency (`pom.xml:385-391`), with no `<annotationProcessorPaths>` on the `maven-compiler-plugin` config (`pom.xml:462-471`). `maven-compiler-plugin` 3.13.0+ deprecates classpath-based processor discovery, and JDK 21+ refuses it outright. Per the official Lombok Maven setup (https://projectlombok.org/setup/maven), both the `provided` dependency *and* an explicit `<annotationProcessorPaths>` entry are required.

Two pre-existing inconsistencies compound the problem:
- `xchange-coinsph/pom.xml` carries a defensive local `<annotationProcessorPaths>` override (and incorrectly redeclares Lombok with `scope=compile`).
- `xchange-coinbase/pom.xml` redeclares Lombok with no scope, leaking it onto the compile classpath.

## Fix

Add `<annotationProcessorPaths>` for `${version.lombok}` to the root `maven-compiler-plugin` config so all ~95 modules inherit it. Keep the existing `provided`-scoped Lombok dependency — it's still required for source-time symbol resolution and IDE support. This matches the official Lombok Maven recipe verbatim, stays on Java 17 (no `<release>` change), and works identically on JDK 17 / 21 / 23.

Drop the now-redundant overrides in `xchange-coinsph` and the stray Lombok redeclaration in `xchange-coinbase`.
Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]