Search code examples
javamavenintellij-ideapom.xml

Intellij finds .class files instead of .java files


After merging some code, Intellij builds my project with a mix of .java files and .class files.

Also when im searching in Intellij (ctrl+shift+n) intellij cant find a few .java files. It only shows me the .class files of this file. But i can find the files via file structure.

I already reimported the pom files. I also deleted the whole project and pulled it again from bitbucket, the problem still stays. When i pull the project from another machine, I dont have this problem.

Thx for help

edit: So i found out the real Problem. I got 3 Modules, but only 2 where decalred as Modules. And i cant mark the Module as an Module, because I deleted some necessary files.


Solution

  • If a problem cannot be reproduced with a fresh clone in a different location, then it is most likely InteliJs project files that has been put under git control, and then later failed to merge properly subtly breaking functionality.

    I would save any work done in this directory, clone anew, apply the saved work, and delete the broken directory. Then I would ensure that .idea/ and *.iml was removed from git control, and listed in .gitignore.