Why are compiler settings in `.idea/compiler.xml` regularly reset?
I have the following setting in compiler.xml to be able to use Spring configuration properties properly. There's a similar setting in pom.xml, but seems that IDEA doesn't take that into account for some reason. To no rely an all DEVs maintaining that setting on their own, the file is part of the Git-repo.
<component name="JavacSettings"> <option name="ADDITIONAL_OPTIONS_OVERRIDE"> <module name="gateway-lib" options="-parameters" /> </option> </component>
The problem is that that it happens really often that IDEA changes that setting to not have a paremter any more. I'm not sure when this happens, it's not as easy as just starting up or something. But at some point it just happens and the setting is lost, IDEA “tells” me because compiler.xml is then part of the current Git changeset. While I switch projects regularly, I don't change settings too often on my own. Though, some of the project use the upper setting and some don't and even the whole “compiler.xml” might not be maintained in Git for some projects at all.
The interesting thing here is that really only “-parameters” is removed, not the entire setting line or something. After I'm reverting the change to that file, things work as expected again until IDEA changes that setting again for some reason.
Does anyone have an idea when this happens and how to prevent it? It's pretty annoying and might easily be not recognized when committing changes.
Thanks!
请先登录再写评论。
Hello, Thorsten!
Thank you for reporting this!
Unfortunately, this setup is inherently unreliable, as IDEA prioritizes Maven settings over IDEA ones.
I believe the original issue stems from the one described in IDEA-371747, which we will be fixing in the upcoming update.
That should provide a permanent solution to this problem.