How to stop IntelliJ from removing modules from Project1 when importing it in Project2?
已回答
We've got multiple projects that contain some shared codebase.
So, Project1 module structure is something like:
- project1-code
- shared-code-1
- shared-code-2
- ...
Now when I try to configure Project2, while adding the modules and having Project1 open as well for reference, I can see the modules disappear from Project1 (from the project-view) when I add them to Project2.
Is it possible to stop this behaviour? As when I have to switch back to Project1, I have to add them again and they will dissappear from Project2... and then I have to add...
Thanks in advance, Marco de Reus
IntelliJ IDEA 2022.3.2 (Ultimate Edition)
Build #IU-223.8617.56, built on January 26, 2023
Runtime version: 17.0.5+1-b653.25 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Linux 6.1.11-76060111-generic
Non-Bundled Plugins:
org.metafactory.plugin (2.3.0-SNAPSHOT)
com.bennycode.linessorterplus (1.1.0)
com.tang (1.3.8-IDEA223)
VisualVMLauncher (1.21.211.6085.0)
com.github.iguissouma.nxconsole (0.54.0)
Kotlin: 223-1.8.0-release-345-IJ8617.56
Current Desktop: pop:GNOME
请先登录再写评论。
What kind of project is it? Do you use a build system like Maven?
How do you add the modules exactly? A short screen recording of the process would be nice.
The main projects are Java. We do use maven but the additional modules are not included by the pom.
Uploaded a screen cast here: https://easyupload.io/ltfdfu (30 days available it says)
When importing the same library (top module of right project) in the left project (using File -> Project Structure -> Module -> Add -> Import Module), it dissappears from the right project.
You are welcome to leave additional comments there. Thanks!