In our team we're using IntelliJ and Eclipse. As formatter we're plugins for Eclipse and IntelliJ from v1.18.1 of https://github.com/google/google-java-format
We set the same imports layouts for both IDEs:
There are differences in imports order:
Imports in IntelliJ:
import com.domain.sap.IF.helper.DocumentHelper;
import com.domain.sap.SapUtility;
import com.domain.sap.SyncDocument;
Imports in Eclipse:
import com.domain.sap.SapUtility;
import com.domain.sap.SyncDocument;
import com.domain.sap.IF.helper.DocumentHelper;
For me it looks like IntelliJ uses a Code Formatter also for Imports formatting and Eclipse uses it's own mechanism. How to make it common?
Try using a
.editorconfig
file on the project. IntelliJ has native support and Eclipse requires a plugin.It will allow to set a lot of import related configurations like