Using Ij with monorepo?
已回答
We have a monorepo project structure where the entire repo (no, it's not that big) consists of many Java and non-Java components:
monorepo (M)
|---- (no build.gradle/pom.xml here)
|-----|top-level-Java-project (J)
-----| build.gradle
-----| module1 (gradle submodule)
-----| module2 (gradle submodule)
-----| ...
|-----|scripts
|-----|config
| ...
When I open the main Java project (J), things work correctly, all references are resolved, I can work normally. But sometimes I do need to update the source code that is directly in M, but not in J. Opening M in Ij gives me several problems, mainly because it is not a Java/Ij project.
Are people running into something like this? What are your recommendations?
请先登录再写评论。
Set up a new module with the content/source roots that you need to edit.
I have a similar same issue. I have a git repo with the following structure:
Few days ago I have been able to mark the git folder as module and the java as module. By that I am able to see all files and Java is mapped correcly. Badly I remove .iml file and nothing works anymore. What is the correct approach to do that? Are there any tutorials?
Hi Wave,
Was the project created from within IDEA or are you importing an existing one into it?
What doesn't work exactly? Can you describe?
Why do you want to remove the .iml file? It is an internal IDE module configuration file. If you've marked a folder as a module, the .iml file is added to it automatically.
Do you have any pom.xml/build.gradle files in your project? Both in git repo root folder and subfolders?
Please attach a screenshot of your project tree view when "nothing works".
Hi @...
Thanks for your reply.
Project Files
Project
The project view should include all files seen in the first image.
The folder frontend folder contains a Java app. I'm able to create a module for it:
But now the root folder for this repo containing for example the backend is not visible anymore.
I can solve this issue by marking the root folder also as a module too. But then I'm obligated to select a language for example Java. IntelliJ then creates a pom.xml-file which I dont need.
Well, now I can simply delete those files and then I'm fine. Altough I'm not sure if this is the correct approach.
Best Regards