You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Lombok code leaks when using Takari Lifecycle + jdt compilerId (via ECJ) + @SneakyThrows, thus forcing the lombok artifact to be available at runtime.
Any other combinations lead to the correct code being generated:
Run java -cp target/classes com.pmartos.App from the project's root folder (the POM is configured to use Java 21 but it should be possible to use Java 11+ if needed)
A ClassDefNotFoundError is returned; there shouldn't be such errors at runtime, but due to point 3 the error happens nonetheless.
In more elaborate applications for which an uber JAR or similar archive is built, the error will likely surface as soon as lombok has scope provided in the project's POM.
Expected behavior
The code does not fail and instead prints a message Successfully thrown and caught! Exception message: This is a test.
The generated code for class com.pmartos.App no longer has a runtime-dependency with Lombok APIs:
Eclipse ECJ 3.33.0 to 3.39.0 (Takari Lifecycle breaks with 3.39.0)
Additional context
None
The text was updated successfully, but these errors were encountered:
pjmartos
changed the title
[BUG] Lombok @SneakyThrows
[BUG] Runtime dependency with Lombok APIs when using @SneakyThrows in combination with ECJ + Takari Lifecycle Plugin
Nov 6, 2024
Describe the bug
Lombok code leaks when using Takari Lifecycle +
jdt
compilerId (via ECJ) +@SneakyThrows
, thus forcing thelombok
artifact to be available at runtime.Any other combinations lead to the correct code being generated:
javac
compilerIdeclipse
compilerId (via Plexus Compiler Eclipse)javac
compilerIdTo Reproduce
mvn compile
from the project's root foldercom.pmartos.App
, we can see that the generated code has a runtime dependency with Lombok APIs:java -cp target/classes com.pmartos.App
from the project's root folder (the POM is configured to use Java 21 but it should be possible to use Java 11+ if needed)ClassDefNotFoundError
is returned; there shouldn't be such errors at runtime, but due to point 3 the error happens nonetheless.In more elaborate applications for which an uber JAR or similar archive is built, the error will likely surface as soon as
lombok
has scopeprovided
in the project's POM.Expected behavior
Successfully thrown and caught! Exception message: This is a test
.com.pmartos.App
no longer has a runtime-dependency with Lombok APIs:Version info
Additional context
None
The text was updated successfully, but these errors were encountered: