Gradle import creates weird top-level directories

Answered

Hello,

every time so gradle change is imported in the IntelliJ project I am working on, I get a number of top-level directories created, containing one .iml file each. Would you know what is doing that and whether I can disable/change this behaviour.  It is odd that on my IDE I get to see all these weird directories and I have to scroll down to see the stuff that I am really working on.

 

elasticsearch$ ls
-1165853381 -635331147 1704620402 CONTRIBUTING.md distribution
-1169892327 -712254633 2063880293 GRADLE.CHEATSHEET docs
-1290541593 -736111065 2077636346 LICENSE.txt elasticsearch.iml
-1410688098 -804683416 208024295 NOTICE.txt elasticsearch.ipr
-1434071603 -877720730 2119498914 README.textile elasticsearch.iws
-1505828218 -931583190 23579497 TESTING.asciidoc gradle.properties
-1552685369 -941914928 428040555 Vagrantfile modules
-158984033 1021675304 586439395 benchmarks plugins
-1671698108 1046731407 655233448 build.gradle qa
-1738302032 1063240426 719719882 buildSrc rest-api-spec
-1826251544 1381722620 902100852 client settings.gradle
-326568915 1513767422 911089367 core test
-379002222 1589931569 955988757 dev-tools

 

0
5 comments

Does it happen with any project? Any steps to reproduce it? What Gradle version is used? Anything related in idea.log?

0
Avatar
Permanently deleted user

It happens with the elasticsearch project: https://github.com/elastic/elasticsearch , yet as far as I know my colleagues don't see the same behaviour with same version of IntelliJ and Gradle. I even compared my config with that of a colleague, and it looks exactly the same, but I only see this behaviour :) Gradle 4.1 and IntelliJ 2017.3, but 2017.2 had the same. If I delete those dirs, they get recreated as soon as a gradle import happens (I have auto-import enabled). Our gradle setup is not the easiest, we have many modules and support a secondary project (for plugins development) that depends on elasticsearch. I suspect this last part is what is causing the directory creation, but not sure.

I can't find anything relevant in the logs.

0

.ipr file is a legacy format and it's not used by IntelliJ IDEA by default. Some external process/tool may be creating these files, like `gradle idea` command, see http://stackoverflow.com/a/42518961/104891.

0
Avatar
Permanently deleted user

yes the .ipr file is created by gradle idea. We do need to run gradle idea the first time we import the project. I am not sure what that has to do with IntelliJ creating these directories though. Anyways, I just cleaned up the project and started from scratch by running gradle idea and then reimporting it in IntelliJ. I am sure I have tried this before with no luck, but this time I can't see any of those directories being created anymore. I am fine with calling this a mystery as long as those dirs don't show up anymore, but I don't think that the ipr file format has to do with it. 

0
Avatar
Permanently deleted user

Nevermind, they reappeared, I have no idea why. Would be nice to know where they come from.

0

Please sign in to leave a comment.