Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intellij 12 - Can't Reimport Module

So I ran into a strange problem today. I was having some issues with one of my modules in IntelliJ so I decided I should try blowing it out and rebuilding it from a fresh checkout. I deleted the module from the Project window and then deleted / redownloaded from my file system.

I went back to Intellij and tried importing the module. It took me through the normal steps of selecting options and then seemed to succeed. Only it didn't reappear in my projects window.

I'm not sure what I did, but recreating the whole project isn't an option at this point. I'm hoping someone can shine some light on why Intellij is angry with me.

System Specs: Mac OSX Mountain Lion IntelliJ 12.1.4

like image 672
Shaded Avatar asked Sep 18 '13 19:09

Shaded


People also ask

How do I remove a module from IntelliJ?

Using IntelliJ 2016.5, to remove a Maven module and it's underlying source code and remove it as a sub-module from the parent, go to the Project Files tab, find the unwanted module and use the triangle symbol to open it, then delete the entry that represents it on disk.

How do I reimport Gradle dependencies in IntelliJ?

In the Gradle tool window, right-click your main project and from the context menu select Composite Build Configuration. In the Gradle Project Build Composite dialog, select projects that you want to include in your Gradle composite build. Re-import your main Gradle project.

How do I add an existing module to IntelliJ?

Import an existing moduleFrom the main menu, select File | New | Module from Existing Sources. In the dialog that opens, specify the path the . iml file of the module that you want to import, and click Open. By doing so, you are attaching another module to the project without physically moving any files.


2 Answers

If this is a Gradle module, please check the .idea project folder there is a gradle.xml

  <GradleProjectSettings>
    <option name="distributionType" value="DEFAULT_WRAPPED" />
    <option name="externalProjectPath" value="$PROJECT_DIR$/xxx" />
    <option name="gradleHome" value="/opt/gradle/gradle-2.13" />
    ......
  </GradleProjectSettings>

you should remove this entry and try to reimport your module

I am using Intellij Idea 2016.1.3, Mac OSX El Capitan 10.11.5

like image 112
clevertension Avatar answered Oct 10 '22 15:10

clevertension


I also had this problem with an SBT module. You can remove the offending module by going to the SBT tool window, right clicking on the module and selecting "Detach external project".

like image 16
musiKk Avatar answered Oct 10 '22 16:10

musiKk