5

Using Lombok to generate code with Eclipse/Maven. Would like to be able to view in text the class which is being generated. Hunted around under target but did not see anything. Is there a way to have Lombok output the generated class?

1
  • 3
    Are you looking for a Eclipse/Maven specific answer or a general one? If second is the case see delombok Commented Apr 11, 2019 at 9:58

2 Answers 2

3

In intellij you can do: Refactor (class) -> delombok -> All lombok annotation

enter image description here

Sign up to request clarification or add additional context in comments.

2 Comments

OP asked for Eclipse/Maven. Also, Delombok doesn't just let you view the generated code, it turns your entire codebase into a Lombok-free one by modifying your source code directly and adding tons of generated code.
As @Christoph pointed out using delombok is not what OP asked for and massively causes unwanted effects.
1

As described here in eclipse you can see the signature of the lombok generated methods in the outline view. Shortcut: highlight the lombok annotated type and press ctrl-o. You can also open an outline view permanently with window/show view/outline.

BTW: In intellij with the lombok annotated type highlighted you can press shift twice to open the search all dialog. The .class resource is among the items in the search result list. If you select that item a tab opens with the decompiled code. Make sure the target directory of your project is not excluded (see details here).

edit: for intellij here is an improved description on how to view .class files.

In both cases it is mandatory of course, that lombok generation (for example with maven) took place beforehand.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.