I will assume that you want to use those imports in your code.
The warnings, in gray, are suggesting you to remove imports of libraries that you are then NOT using in your code (in order to save resources and gain other advantages).
The errors, in red, are related to the lack of availability of the specified library in your local environment (in other words Lombok dependency is not properly installed).
The command “mvn clean” will remove local dependencies installed using Maven. This could indeed be the cause of the error itself, you removed Lombok jar file from your local install using “mvn clean”.
To know more about this topic and be sure to fix the related error I’d need to see your POM.xml file.
Nonetheless I would like to try to provide help right away.
Assuming that your POM.xml looks good in order to successfully import the missing libraries you’d need to run:mvn clean install -U
And then run a rebuild (from IntelliJ Rebuild menu), this should take care of the red import errors. Then, to remove the warnings, you should just use the imported libraries in your code.
Here’s an example that would remove the warning related to Date, just as an example:
String pattern = "yyyy-MM-dd";
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);
String date = simpleDateFormat.format(new Date());
System.out.println(date);
IntelliJ will scan your code, see that “Date” import is used and stop generating the related warning.
If, on the other hand, you are not using those import statements I would just suggest to simply remove the unused import lines from the class. The end result will be the same, you will no longer get errors and/or warnings.
A very neat way to obtain this result in IntelliJ is the Optimize Imports function.
Here its current shortcut:
Ctrl+Alt+O
This will take care not only of removing the unused imports but also to optimize them in order to minimize resource usage and attack surface.
Please write a comment if you need more clarity or other explanations, I’d be glad to help.