[Maven] Content root is added on every restart of IntelliJ
已回答
Hi everyone!
This must be a simple configuration issue, but I have a project where I added Maven to. Everything is working fine, however my project structure is doing some weird things. The content root configuration for my module was already set. Now that I have Maven, this is imported from the pom. IntelliJ though keeps on loading that and adding content root upon content root. I guess that shouldn't be the case right? :)
Thanks for any help,
Vincent
请先登录再写评论。
Do you see same issue: IDEA-284553 Source root is duplicate?
Could you please attach screenshot showing the problem, the project configuration files (the .idea directory and module's .iml files) and IDE logs zipped (use Help | Collect Logs and Diagnostic Data action after Reload action in maven tool window).
For uploading you can use https://uploads.jetbrains.com or any file sharing service.
It should probably help to re-import project (deleting existing project configuration) as a Maven project anew.
It seems like the same issue indeed, removing the .idea folder didn't solve it unfortunately. I don't think I have .iml files, those are for the IDEA module system right? I'll attach some screenshots and the log, thanks for replying!
All files are here: 2022_02_07_SNqm4FM4szNnR4rJ
Thanks. Unfortunately see no suspicious issues in logs. Is it possible to get a sample project where this is reproduced?
Please make sure to check the latest version from https://www.jetbrains.com/idea/download/
Also try if is helps to disable the Settings (Preferences on macOS) | Build, Execution, Deployment | Build Tools | Maven | Importing | Store generated project files externally option.
Latest version indeed, unfortunately that didn't do the trick either. I do get an .iml file now:
Not seeing anything really wrong there, it doesn't hurt for me to remove the content roots, it's just annoying. :)
Could you please zip all the project's configuration files, representing the full project structure (complete `.idea` directory and .iml files in locations of their modules)?
I can, but it's solved! ;) I decided to rename the project, rename the directory in which it resides etc. Then removed the .idea, build and target directories and now it's not showing this behavior anymore. I also renamed the project accordingly in the pom.xml, I'm wondering if I had a naming conflict perhaps that would create new content roots? Still wouldn't make a lot of sense that it would do this over and over though.
Thanks for the information. Do you have project configuration at a state when the issue is reproducible?
Didn't save it in that state unfortunately. Do you still want them in the current state? I'm guessing there's not a lot to be found now.
Yes, provide the current project files state, please just in case. Thank you!
So, the complete .idea folder I already uploaded above, which was the weird state. The iml files I don't have it seems, the way I have the project.