It is recommended to add the function of importing modules in batches, because importing modules one by one is too troublesome.

Answered

It is recommended to add the function of importing modules in batches, because importing modules one by one is too troublesome.

0
7 comments
What does your project structure look like? If the modules' info is configured in your build scripts(pom.xml/build.gradle), you can open the build script file directly.
0

哈哈看了你的头像,感谢。

For example, I created an Empty Project abc with 60 submodules in it. One day, abc project could not be opened by idea due to the loss of related files, so I need to create a new empty project named xyz. Then import the 60 submodules into xyz's empty project one by one, one by one is too cumbersome.

0
If it's a Maven or Gradle project, the modules' configuration is defined in the build script. Simply open the build script file should be able to include all the modules.

Generally, if there are modules not imported, IDE will notify the users when it opens the project root.

If the modules are defined in .iml files, and as you mentioned the modules are gone due to some reason, you can try to restore the .idea/modules.xml file and reopen the project. There are modules definitions in that xml file.

Another way to add modules is to right-click on the .iml / pom.xml / build.gradle files inside the sub modules and select add / load them menu.
0

In my case, only the new module, parent project iml file or other files in the parent project are all gone, in this case, i create new empty project , next step can only one import?

0
Hello, did the .iml file on the same computer before? Is it found in the menu File | Local History | Show History… ?

Usually, you can put these files in a version control system, like Git. So far there is no batch way to import modules unless they are using Gradle/Maven build system etc.
0

I'm just creating a maven project of type quickstart. My situation: only the sub-module folder, no iml file of the parent project, all files of the parent project are gone. If I create a new Empty Project, can't I batch import 100 maven submodules? Do you want to import them one by one? I'm just creating a maven project of type quickstart. My situation: only the sub-module folder, no iml file of the parent project, all files of the parent project are gone. If I create a new Empty Project, can't I batch import 100 maven submodules? Do you want to import them one by one?

0
It seems you are facing the same issue like here: https://stackoverflow.com/questions/77935471/multimodal-project-in-intellij-cant-recognize-java-nor-any-main-class

Did you ever put a pom.xml and define all the submodules in the root folder? It should be like this:
...

spring-cloud-function-dependencies
spring-cloud-function-core
spring-cloud-function-context
spring-cloud-function-web
spring-cloud-starter-function-web
spring-cloud-starter-function-webflux
spring-cloud-function-samples
spring-cloud-function-deployer
spring-cloud-function-adapters
spring-cloud-function-integration
spring-cloud-function-rsocket
spring-cloud-function-kotlin


If yes, then it will be automatically imported.

You may share a directory project structure screenshot to help us understand the issue.
0

Please sign in to leave a comment.