Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ Auto build with errors but not errors in editor

I'm Using IntelliJ IDEA Ultimate 2019.2 to work on a Java w/gradle project.

When I try to run a JUnit test the Autobuild is triggered and it complains with the following message:

Auto build completed with errors

In the Problems tab I see over 100 errors, but when I click on them to investigate I can see that these are not real errors! The editor has no red squiggly anywhere and if I look into specific errors (like java: cannot find symbol) I confirm they are invalid errors.

I've tried "Invalidate Caches / Restart" and "Rebuild Project" with no luck

like image 644
Adolfo Avatar asked Dec 04 '25 12:12

Adolfo


2 Answers

I tried many things, but I think the issue got resolved when I switched the Gradle "Build and run using" setting from Gradle to IntelliJ. gradle settings

like image 68
Adolfo Avatar answered Dec 07 '25 00:12

Adolfo


I'm posting this here because this is the first result in google about this issue for MAVEN (even though this question is marked for gradle). This fix comes from a humble comment here.


MAVEN FIX:

For some reason... this issue happens when you turn on Delegate IDE build/run actions to Maven, BEFORE you turn on > Tools > Actions on Save -> "Build Project" (A.K.A. Auto-build). Steps to fix:

  1. Turn both off.
  2. Then turn on Auto-build (and Reload Maven Project and Rebuild Project)
  3. And THEN turn on "Delegate IDE build/run actions to Maven" and "Rebuild Project".
  4. That's it, your next "Auto-build" will work and it will stay working.
like image 26
luiscla27 Avatar answered Dec 07 '25 02:12

luiscla27