내 커뮤니티 업적 표시줄을 확대합니다.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

활동이 없어 이 대화는 잠겼습니다. 새 게시물을 작성해 주세요.

해결됨

Lombok in AEM

Avatar

Level 1

Hello Folks,

Can somebody help me how can Lombok be integrated into AEM project to avoid boilerplate code? Is there any documentation by Adobe? Appreciated if someone can gives with example please. 

Thanks!

1 채택된 해결책 개

Avatar

정확한 답변 작성자:
Community Advisor

Hi @ahana_k ,

"Project Lombok is a java library that automatically plugs into your editor and build tools, spicing up your java.
Never write another getter or equals method again, with one annotation your class has a fully featured builder, Automate your logging variables, and much more."

For more details please read official documentation [0].

How can Lombok be implemented in AEM?

I haven't found any documentation from Adobe. However, there are plenty of un-official sites by visiting them you can understand how it works & how can it be implemented in AEM.

  • You can add “Lombok” in your maven project as maven dependency. To include lombok as a 'provided' dependency, add it to your <dependencies> block like so:

    <dependencies>
    	<dependency>
    		<groupId>org.projectlombok</groupId>
    		<artifactId>lombok</artifactId>
    		<version>1.18.24</version>
    		<scope>provided</scope>
    	</dependency>
    </dependencies>

Here are some sites where you can see some practical along with examples [1], [2].

[0]: https://projectlombok.org/

[1]: https://blogs.perficient.com/2021/06/14/writing-less-java-code-in-aem-with-sling-models-lombok/

[2]: https://www.linkedin.com/pulse/code-generator-aem-sling-models-lombok-sandip-kumar/?trk=pulse-articl...

Hope that helps!

Regards,

Santosh


Santosh Sai

AEM BlogsLinkedIn


원본 게시물의 솔루션 보기

1 답변 개

Avatar

정확한 답변 작성자:
Community Advisor

Hi @ahana_k ,

"Project Lombok is a java library that automatically plugs into your editor and build tools, spicing up your java.
Never write another getter or equals method again, with one annotation your class has a fully featured builder, Automate your logging variables, and much more."

For more details please read official documentation [0].

How can Lombok be implemented in AEM?

I haven't found any documentation from Adobe. However, there are plenty of un-official sites by visiting them you can understand how it works & how can it be implemented in AEM.

  • You can add “Lombok” in your maven project as maven dependency. To include lombok as a 'provided' dependency, add it to your <dependencies> block like so:

    <dependencies>
    	<dependency>
    		<groupId>org.projectlombok</groupId>
    		<artifactId>lombok</artifactId>
    		<version>1.18.24</version>
    		<scope>provided</scope>
    	</dependency>
    </dependencies>

Here are some sites where you can see some practical along with examples [1], [2].

[0]: https://projectlombok.org/

[1]: https://blogs.perficient.com/2021/06/14/writing-less-java-code-in-aem-with-sling-models-lombok/

[2]: https://www.linkedin.com/pulse/code-generator-aem-sling-models-lombok-sandip-kumar/?trk=pulse-articl...

Hope that helps!

Regards,

Santosh


Santosh Sai

AEM BlogsLinkedIn