How to configure gradle spotless pugin to replace .* imports and sort fields and methods in Intellij

181 Views Asked by At

I am using Java 17 with IntelliJ 2023.2.2 and attempting to configure the Gradle Spotless plugin to replace

import java.util.*

with individual class imports, such as

import java.util.List;
import java.util.Map;

The post I found Remove unused imports from java project using gradle suggests using an external Eclipse config to handle this, but since I only use IntelliJ and not Eclipse, I wonder if it's possible to configure IntelliJ's code style XML to replace the .* imports. Additionally, I would like the Spotless plugin to sort the fields and methods by name. Is this possible?

I have tried various configurations, but none of them worked.

0

There are 0 best solutions below