Intellij 12 - Can't Reimport Module

前端 未结 9 732
野性不改
野性不改 2021-02-01 15:00

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 checko

相关标签:
9条回答
  • 2021-02-01 15:22

    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".

    0 讨论(0)
  • 2021-02-01 15:32

    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

    0 讨论(0)
  • 2021-02-01 15:34

    1.delete the file .idea/modules/your module.iml 2.edit the file .idea/gradle.xml del about your module like this:

    <GradleProjectSettings>
        <option name="distributionType" value="LOCAL" />
        <option name="externalProjectPath" value="$PROJECT_DIR$/../fs-jycloud-monitor" />
        <option name="gradleHome" value="$USER_HOME$/gradle/gradle-2.14.1" />
        <option name="modules">
          <set>
            <option value="$PROJECT_DIR$/../fs-jycloud-monitor" />
          </set>
        </option>
      </GradleProjectSettings>
    
    0 讨论(0)
  • 2021-02-01 15:34

    A cleaner solution would probably be to first try File -> Invalidate Caches / Restart....

    0 讨论(0)
  • 2021-02-01 15:36

    Click on your Gradle tab, right-click on your project, click on 'Reload Gradle Project'

    0 讨论(0)
  • 2021-02-01 15:37

    Ah ha! I think I found the answer.

    In my .idea project folder there is a misc.xml. In this file I found

    <option name="ignoredFiles">
        <set>
            <option value="$PROJECT_DIR$/../Projects/.../module/pom.xml />
        </set>
    </option>
    

    I removed that and also cleaned up some duplicate entries from other areas that pertained to my module and I was able to import again.

    IntelliJ is pacified for at least another day!

    0 讨论(0)
提交回复
热议问题