Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] After Lombok adding to dependency Gradle cannot access to javax.xml.* library #3458

Open
MaltsevDmytro opened this issue Jul 12, 2023 · 3 comments

Comments

@MaltsevDmytro
Copy link

Describe the bug
When I added Lombok dependency to my build.gradle file and lombok.config file I cannot compile my project with error cannot access XmlRootElement. After investigation I find out that transient dependency provided by third party library javax.xml is absent in my dependency tree. I was trying to built project through, gradlew file, internal gradle of IntelijIdea and installed gradle on my pc, also invalidate cache, reinstall IDE, redownload project from remote repository. Also changing Lombok version from 1.18.28 to 1.16.20 didn't help. When I remove all new deps and files everything works fine.

To Reproduce
Stacktrace of gradle build:

> Task :compileJava FAILED
error: cannot access XmlRootElement
  class file for javax.xml.bind.annotation.XmlRootElement not found

lombok.config:

config.stopBubbling = true
lombok.addLombokGeneratedAnnotation = true
lombok.extern.findbugs.addSuppressFBWarnings = true
lombok.anyConstructor.addConstructorProperties = true

build.gradle:

dependencies {
    annotationProcessor(group: 'org.projectlombok', name: 'lombok', version: LOMBOK_VERSION)
    compileOnly(group: 'org.projectlombok', name: 'lombok', version: LOMBOK_VERSION)

    //Other deps
}

Expected behavior
Build without any errors

Version info (please complete the following information):

  • Lombok - 1.18.28
  • Gradle - 8.2
  • JDK - OpenJDK 17.07
  • MacOS - 13.4
  • IntelijIDEA - 2023.1.3 (Ultimate Edition)
@Rawi01
Copy link
Collaborator

Rawi01 commented Jul 12, 2023

Lombok does not generate code with this annotation. Why do you think this is a lombok problem and not one related to the other dependencies or your project code?

The compiler should print a location where this annotation is used, that should help you to find the root cause.

@MaltsevDmytro
Copy link
Author

MaltsevDmytro commented Jul 17, 2023

I doublecheck and I am sure that Lombok somehow trigger this problem, all messages from complier is presented in previous comment.

@alexanderankin
Copy link

can provide a reproducer or the rest of the dependency list?

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

No branches or pull requests

3 participants