-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
Describe the bug
Trying to test an application with both ASM and lombok fails.
"Potential easy solution" (TM): Rename the lombok shaded ASM package, so other software does not fail.
To Reproduce
Trying to use ASM and lombok at the same time will fail when running Tests (using IntelliJ or Maven).
As far as i can see everything is as described by https://projectlombok.org/setup/maven.
Note that running the main Method works, however running jUnit will fail.
I created a minimal reproduceable example.
The error basically says that ASM is used by both lombok and ASM.
java.lang.LayerInstantiationException: Package org.objectweb.asm in both module lombok and module org.objectweb.asm
Expected behavior
Testing works out of the box and the Project compiles.
Version info (please complete the following information):
- Lombok version 1.18.28
- Platform maven 3.9.2 and IntelliJ IntelliJ IDEA 2023.2 (Ultimate Edition) Build #IU-232.8660.185, built on July 26, 2023
Additional context
See #2549 and #2973
PS: Thanks for the great software! I love using lombok, but it's quite a shame the issue above occurs. The previous listed issues boil down to:
- Use explicit Annotation Processor (i specified them)
- Require static lombok (i do)
- No minimal example provided (see above)
- User Error (I don't see how i'm doing something wrong, and i don't think JUnit / Maven is doing something explicitely wrong. Especially given, that lombok can be quite helpful generating Test Data Classes, where records do not suffice.
I'd be willing to give a try implementing reshading, but understanding the code base has been quite hard for me in the past.
So any pointer, if that change would be welcome, would be appreciated.