Posts

Showing posts from July, 2025

Liferay Workspace: Code Formatter

  Liferay Workspace: Code Formatter How to integrate Spotless Code Formatter to a Liferay Gradle Workspace 1. What is Spotless? Spotless is a nice tool that can auto-format code for multiple programming languages using different build tools to ensure consistent codestyle across the project. It supports different configuration options to provide developers with the possibility to define project-specific codestyle preferences and restrictions. Using code formatters like Spotless you can prevent different code formatting approaches in a single project, make sure the codebase is consistent, avoid possible merge conflicts, and reduce time spent for code reviews. 2. How to integrate Spotless to a Gradle module? To integrate Spotless plugin to a Java module in the Liferay Gradle Workspace you need to: Define Spotless plugin in the module’s build.gradle: plugins {    id "com.diffplug.spotless" version "7.2.1" } Specify Spotless configuration: spotless {    ja...