Intellij 2020.1 won't use my local repository

Answered

Hello, so here is my problem:

Using Intellij IDEA 2020.1 (I'm basically blocked from using any other version) to code in Java.

I'm working on a maven project with multiple modules in an environment where there is zero direct access to the internet, and I'm relying on a maven repo that's within the LAN. I have set maven appropriately for this, and using "mvn clean install"  in command works perfectly fine.

I have made sure that I have a super pom has all the relevant dependencies and versions, and that all the modules include the relevant dependencies.

However, Intellij is acting in a very random way: in the source code, some imports are marked as "cannot be solved" (despite the maven dependency being in the module's pom), and some look completely fine, but return a compilation error "package does not exist" when building/rebuilding.

What I tried: 

  • Making sure that File > Settings > Build, Execution, Deployment > Built Tools > Maven point to my maven and its config files.
  • Re-import all maven projects from the Maven window.
  • Clearing the .idea folder as all as all .iml files in all modules, and re-importing the maven project through the pom.xml file.
  • Deleting the entire project, cheking it out with git, and importing it in intellij afterwards as a maven project.
  • Importing from git directly into intellij.
  • Invalidate the cache and restart/rebuild.
  • Deleting my local .m2 repo.
  • Import the project directly in Intellij directly from git instead of using git and maven in command line.
  • Closing Intellij, using mvn idea:clean and deleting the .idea folder, than re-opening in Intellij.

...I am running out of ideas. I found this topic that describe exactly that kind of issue for version 2019.1.2, and it was apparently solved by the version 2019.2 EAP, which is a version older than mine (2020.1).

If somehow only a newer version of Intellij IDEA is the answer, please say so, as I might be able to use that push for access to it.

Thanks in advance!

EDIT: surprisingly enough, the community edition of Intellij Idea 2020.1 doesn't have this issue for me and immediately works as expected. 

0
3 comments

>using mvn idea:clean and deleting the .idea folder, than re-opening in Intellij.

Using maven idea plugin to generate IDEA project configuration files is not recommended. This Maven goal may produxe incompatible configuration files. Please try to re-import project into IDE from scratch: delete .idea directory and open project via File | New action pointing to the main pom.xml file.

0

I resorted to the idea maven plugin, which I did know was broken, because there was literally nothing else left for me to try, to make a point at how stuck I actually am (which is why it's last in the list: I didn't START with that).

I tried the solution you're providing (and a couple of other ways of importing/re-importing a maven project) without success, and added a bit more details in the OP when it comes to re-creating/re-importing the project. Nothing worked.

0

Please upload IDE logs (use Help | 'Collect Logs and Diagnostic Data' action to collect them) after opening the project and reproducing the problem. Please also provide screenshots or a small screencast showing the problem in the IDE. For uploading you can use https://uploads.jetbrains.com or any file sharing service. Thank you.

0

Please sign in to leave a comment.