Module compiles, but editor shows compilation issues

Since I reorganized my environment today (New project, clean checkout of code from SVN), I have not been able to edit code without the editor showing 'compilation issues' for code that does actually compile.

I have a bunch of Maven modules that compile file using Maven (both from command line and from IDEA) and compilation from IDEA (Build -> Compile/Make) works as well.
But when opening one of the java files, all referenced types that do not originate from my Maven module itself (types from dependencies) are marked as compilation problems ('Cannot resolve symbol XYZ') in the editor. Code completion only reveals types from dependencies when I type the fully qualified name, but a type entered this way is still displayed as a compilation problem (red).

I have no clue what is going wrong here. Has any encountered this behaviour before? I am using IDEA 13.1.1.

3 comments

Try invalidating your caches and restarting IDEA (File > Invalidate Cache). Wait for IDEA to re-index your project (Status indicator on lower right status bar). The caches will sometimes become corrupted. This is most likely to occur upon reorganizing a project as you mentioned you did.

0

That solves my issue! Thank you very much!

0

Hello, 

 

I have the same kind of problem.

The module is compiling with success. But the editor shows me red errors for the objects referreing to a transitive maven dependency of my module.

For example Spring and hibernate are used in my code, but the dependency to spring and hibernate is transitive.

I tried the invalidate caches solution, but it doesn't resolve my problem.

Could you please help?

Thxs, 

Fatma.

2

Please sign in to leave a comment.