Skip to content

Use classpathFromResources for lombok in Java templates#997

Merged
jkschneider merged 1 commit intomainfrom
jkschneider/classpath-classloader
Mar 1, 2026
Merged

Use classpathFromResources for lombok in Java templates#997
jkschneider merged 1 commit intomainfrom
jkschneider/classpath-classloader

Conversation

@jkschneider
Copy link
Member

Summary

  • Switch all lombok JavaParser classpath resolution from classpath("lombok") to classpathFromResources(ctx, "lombok") across the lombok recipe visitors
  • Add org.projectlombok:lombok:latest.release to parserClasspath in build.gradle.kts and update classpath.tsv.gz

Context

classpath("lombok") resolves the classpath entry from the classloader, which fails when the version-specific parser is loaded by a different classloader. classpathFromResources resolves via the resource path instead, avoiding the classloader mismatch.

Test plan

  • Existing lombok recipe tests continue to pass

`classpath("lombok")` resolves the classpath entry from the
classloader, which fails when the version-specific parser is
loaded by a different classloader. Switch to
`classpathFromResources(ctx, "lombok")` which resolves via
the resource path instead.

Also add lombok to the parserClasspath in build.gradle.kts and
update classpath.tsv.gz accordingly.
@github-project-automation github-project-automation bot moved this to In Progress in OpenRewrite Mar 1, 2026
@jkschneider jkschneider merged commit eec22b2 into main Mar 1, 2026
1 check passed
@jkschneider jkschneider deleted the jkschneider/classpath-classloader branch March 1, 2026 22:33
@github-project-automation github-project-automation bot moved this from In Progress to Done in OpenRewrite Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant