コミュニティアチーブメントバーを展開する。

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