Location of module settings for Gradle Wrapper project without .iml files under $PROJECT_DIR$
Answered
I imported a Gradle Wrapper 6.0-rc-1 project into the latest IntelliJ 2019.3 EAP.
No .iml files were created anywhere under $PROJECT_DIR$.
I put some semi-colon-separated paths in the Project Settings > Modules > Sources > Exclude Files text box.
Those files are correctly excluded.
If I restart IntelliJ, the Exclude Files setting remains the same (i.e. it has been persisted somewhere).
I cannot find the text I used for that setting anywhere under $PROJECT_DIR$.
I assume that the settings are stored somewhere outside the $PROJECT_DIR$. Can you tell me where the settings are saved?
Thanks.
Please sign in to leave a comment.
Try removing .idea folder, if you need to reset this setting. We also recommend using build.gradle for exclude and other project-related settings.
I can reset the setting by changing the value in the dialog. I just want to kno where the value is persisted.
Also, it seems that the above setting excludes files from inspections, and from the Open File… dialog. I only want to exclude from inspections, not from Open File… Is there any way to only exclude from inspections? I’d prefer to do this in a Gradle file, rather than in comments / annotations directly in the files that I want to exclude.
But I’d still like to learn where settings are persisted.
>No .iml files were created anywhere under $PROJECT_DIR$.
By default in Gradle based project .iml files are stored in IDE caches directory and are hidden from the user, because they are not intended to be touched and shared by the user since these are auto-generated files. Instead you need to make any project structure configurations in build.gradle script.
If by some reason you want to have .iml files under .idea project configuration you can enable Generate *.iml files for modules imported from Gradle option in Gradle settings.
I don't want *.iml files under .idea. I just want to see the ones that are stored under the cache directory. Can you tell me exactly where they're located? The following command line didn't find any files:
find ~/Library/Caches/IntelliJIdea2019.3 -name "*.iml"
>I just want to see the ones that are stored under the cache directory.
But why do you need it, could you clarify? They are stored specifically in caches b/c it is not intended to work with them.
They are stored under external_build_system directory as xml configuration files.
I was experimenting with settings to try to exclude certain files from inspections, but nothing else (e.g., I still want to be able to open the files from the Open File… dialog). I forget now why I wanted to see the files where settings are stored externally, but, when I get back to it, I’ll let you know.
I need to delete the external_build_system folder because IDEA is refusing to load Gradle subprojects from folders which were previously excluded, even if they're not supposed to be excluded anymore... I don't know what's the point of saying you shouldn't "need" to see internal files. Obviously you shouldn't, but IDEA is nowhere near bug-free for that to be the case. Just in 2022.3, I ran into two issues already that needed me to manually delete these "hidden" files.
Chylek your issue is a bug that was reported and reproduced:
IDEA-307317 Gradle project not loading modules that have been previously excluded (regression in 2022.3)
I hope we will resolve it soon. The issue also contains a workaround that does not require to touch external_build_system directory.
Yes, I reported the issue once I could verify it was still happening in 2022.3, since I found it in 2022.3 RC 2 and I was stuck on that version because the YouTrack plugin completely broke after the update to 2022.3 (or rather it looked that way, since Toolbox automatically updated the plugin to a broken version, and rolling back to RC 2 reverted it to the working version). There have been a lot of bugs in this update cycle...