Unable to create modules in complex project subdirectory and module structure

Answered

My company's software build system, because language-heterogeneous, creates a "sandbox" system that's difficult to integrate into an IDEA project. Attempting to File -> New -> Module from existing sources to make module1 leads to main.iml and test.iml with main and test subdirectories in bold in the Project view. Of course, I expect module1 and module2 to be in bold after and I expect module1.iml and module2.iml.

Thoughts?

 

Project set-up:

project                     --root in IntelliJ

`-- code

   +-- pom.xml

   `-- component        --will not have own source code; just subsumes multiple modules

       +-- pom.xml

       +-- module1       -- cannot get IDEA to make this a module

       |    +-- pom.xml

       +   `-- src          (main/java, test/java, etc.)

       `-- module2       -- cannot get IDEA to make this a module

            +-- pom.xml

            `-- src          (main/java, test/java, etc.)

5 comments
Comment actions Permalink

Mistake on line

+    `-- src

change to

|     `-- src

0
Comment actions Permalink

Try importing pom.xml files instead.

0
Comment actions Permalink

I guess I'm new enough to IntelliJ that I don't know what that means. Do you mean dump the project (erase .idea) and re-open by selecting the top-level pom.xml or something more surgical?

0
Comment actions Permalink

Yes, just open the root pom.xml to import the project from Maven.

0
Comment actions Permalink

This didn't work because only code has a pom.xml and not the sandbox root (code's parent), which I need because it's got pre-built resources in it I have to use (which I did not show you--not your fault).

However, by expanding the right-edge Maven Projects view, clicking + and adding module1 solves the problem once I then go into Project Settings and arrange everything. I think this is the "surgical" version of what you were suggesting.

Thank you very much!

1

Please sign in to leave a comment.