Skip to content

UID2-1750: add explicit Lombok dependency (was relying on transitive)#615

Merged
sunnywu merged 3 commits into
mainfrom
syw-UID2-1750-lombok-explicit-dependency
Apr 7, 2026
Merged

UID2-1750: add explicit Lombok dependency (was relying on transitive)#615
sunnywu merged 3 commits into
mainfrom
syw-UID2-1750-lombok-explicit-dependency

Conversation

@sunnywu
Copy link
Copy Markdown
Contributor

@sunnywu sunnywu commented Apr 1, 2026

Summary

  • Add Lombok 1.18.34 as provided + optional dependency explicitly in pom.xml
  • Register Lombok as an explicit annotationProcessorPath in maven-compiler-plugin

Why

uid2-admin uses Lombok annotations (@Getter, @AllArgsConstructor, lombok.val in 9 files) but was silently relying on Lombok leaking transitively from uid2-shared's incorrect compile-scope declaration. The companion PR IABTechLab/uid2-shared#610 fixes uid2-shared to declare Lombok as provided+optional, stopping the transitive leak. uid2-admin must therefore declare Lombok explicitly. See UID2-1750.

Test plan

  • mvn compile passes (151 source files, 0 errors)
  • mvn test passes (698 tests, 0 failures, 1 skipped)
  • mvn dependency:tree | grep lombok shows provided scope (not compile)

Merge uid2-shared companion PR first, then this one.

🤖 Generated with Claude Code

uid2-admin uses Lombok annotations (@Getter, @AllArgsConstructor,
lombok.val) but was relying on Lombok being leaked transitively from
uid2-shared's compile-scope dependency. Now that uid2-shared correctly
scopes Lombok as provided+optional, uid2-admin must declare it explicitly.

- Add Lombok 1.18.34 as provided+optional dependency
- Register Lombok as annotationProcessorPath in maven-compiler-plugin

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment thread pom.xml
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.34</version>
<scope>provided</scope>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't need provided and optional here because uid2-admin is a leaf project

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

claude said:

  • optional — agree. optional prevents the dependency from being inherited by downstream projects. Since uid2-admin is a leaf application (nothing
    depends on it as a library), it has no downstream consumers, so optional is indeed pointless here.
  • provided — disagree. provided is actually correct for lombok regardless of whether it's a leaf project. Lombok is a compile-time annotation
    processor — it generates bytecode at compile time and is not needed at runtime. Using provided keeps it out of the final fat JAR, which is the right
    behavior. This is standard practice for lombok in Maven projects.

The reviewer's "leaf project" reasoning only fully applies to optional. For provided, the reasoning is about compile-time vs runtime, not about
dependency inheritance.

sunnywu added 2 commits April 7, 2026 15:00
uid2-admin is a leaf project with no downstream consumers, so optional
serves no purpose. Keep provided since lombok is compile-time only.
@sunnywu sunnywu merged commit d452ae7 into main Apr 7, 2026
4 checks passed
@sunnywu sunnywu deleted the syw-UID2-1750-lombok-explicit-dependency branch April 7, 2026 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants