IDEA clobbering modules with same directory name

Hi All,

I have the following project structure:

module bar in /bar/bar.iml
module foo.bar in /foo/bar/foo.bar.iml

Whenever I restart IDEA, it decides that the two modules are the same and /bar/bar.iml gets overwritten with the data from foo.bar.iml.

Anyone else have the same problem? Any solutions?

Thanks,
Jad.

4 comments
Comment actions Permalink

Hello.

Can't reproduce.

You can take a look at the project's .idea/modules.xml. Are both paths to the .iml files, including all directory and file names, correct?

Regards,
Alexander.

0
Comment actions Permalink

I should also say that I'm using gradle for the new module. Here's exactly what happens:

- Module /bar/bar.iml already exists (and it's an ant module).
- I create gradle project /foo/bar/foo.bar.iml.
- I restart IDEA
- Problem: IDEA seems to then create /foo/bar/bar.iml, and module.xml has the correct info for /bar/bar.iml and /foo/bar/foo.bar.iml BUT it also has the new module /foo/bar/bar.iml, and the info from /foo/bar/foo.bar.iml gets written into /bar/bar.iml

I've tried fixing it multiple times but everytime I restart, it breaks. I'll try it in a clean project and see if I can reproduce and post it.

0
Comment actions Permalink

I was able to reproduce part of the problem on creating a module, but not the whole problem. Here's what to do:

  1. Create a new Java project: ~/tmp/test
  2. Create a new Java module:
    • module name: bar
    • Content Root: ~/tmp/test/bar
    • Module file location: ~/tmp/test/bar
  3. Create a new Gradle module:
    • Module name: foo.bar
    • Content root: ~/tmp/test/foo/bar
    • Module file location: ~/tmp/test/foo/bar
  4. Select all the defaults for the Gradle module
  5. Note how the original bar module is no longer specified as a module in the navigation tree.
  6. Open the Project Structure window, select the bar module, and note that the content root was changed to ~/tmp/test/foo/bar
  7. In a text editor, open ~/tmp/test/bar/bar.iml and note how all the paths have been changed to the foo.bar location.


When I replace ~/tmp/test/bar/bar.iml with its previous version before adding foo.bar, IDEA restarts OK.

My original project has many modules, and the interaction might be causing the extra breakage in the modules.xml and the creation of the additional .iml as my previous message specified. LMK if there's anything else I can do. For now, I've given up and now just make sure that each directory I create has a unique name...

0
Comment actions Permalink

Jad, thank you for reporting this! I've created http://youtrack.jetbrains.com/issue/IDEA-118040.

Victoria

0

Please sign in to leave a comment.