Reload All Maven Projects breaks our whole setup.
Problem description:
Our project contains both modules compiled in JDK 11 and JDK 1.8 for historical reasons (configured in our pom.xml files), but now every “Reload All Maven Projects” breaks our whole setup.
Steps to reproduce:
When i reload All Maven Projects, - all my modules are overwitten to default SDK (11) instead of keeping specific SDK. - Override compiler parameters are added for my module specically compiled in JDK 1.8. It's impossible to compile the project (UTF-8 error en JDK 1.8 error)
The only workaround we found is to make 2 PowerShell scripts that we must apply after each Maven reload ! - the first modify the XML files in "[user]\AppData\Local\JetBrains\IntelliJIdea2026.2\projects\external_build_system\modules" - the second remove ADDITIONAL_OPTIONS_OVERRIDE section in idea\compiler.xml"
I uploaded a detailled description in PDF via the JetBrains Upload Service.
Upload ID: 2026_08_14_dtzbyTAiRfRJsT8zKcTqyN
File: Bug IntelliJ multiple SDK.pdf
Environment:
Intellij 2026.2.1 on Windows With the 2024 versions of IntelliJ, we didn't have this issue, just so you know how to get back to how it worked before please ? Thanks in advance
Best Regards
Frédéric Leseigneur
Kelio
请先登录再写评论。
Bonjour Frédéric,
For Maven projects, IntelliJ treats the POM as the source of truth and rewrites the module descriptors under
...IntelliJIdea2026.2\projects\external_build_system\moduleson every Reload All Maven Projects. Any manual per-module SDK tweaks done directly in those XMLs or via the UI are not stable and will be overwritten on reload.So make sure you have a consistent
maven-compiler-pluginconfiguration with either:<release>8</release>/<release>11</release>, or<source>1.8</source>,<target>1.8</target>vs<source>11</source>,<target>11</target>Also configure
<encoding>UTF-8</encoding>there.If the issue remains, please share your pom.xml - or, ideally, the entire project (or a small stripped down version) where I can test this.
To avoid automatic creation of
ADDITIONAL_OPTIONS_OVERRIDE, try the following:In the Registry, search for the
maven.import.compiler.argumentskey:.idea/compiler.xml(or at least the<option name="ADDITIONAL_OPTIONS_OVERRIDE">…</option>block), then start the IDE and Reload All Maven Projects once.If it doesn't help, I will definitely need your project to investigate what happens.
Hi Arina, thanks for your reply. I tried your solution but nothing works when in reload all maven projects. All my "punching-controler-* projects are reassigned to SKD11 but i want jdk 1.8 !
I can't send you the entire project (it's too large). However, here is an excerpt from my project tree containing only the pom.xml files. I hope this helps you troubleshoot the issue. Thanks a lot.
Upload id: 2026_08_17_9GNMmmg38coC5VndKRKTgb (file: Kelio-poms.zip)
Hi Frédéric,
Thanks for the ZIP with the POMs, that made it much clearer what’s going on.
From the tree you sent:
ergo-software-racine/pom.xmlconfiguresmaven-compiler-pluginwith<release>11</release>– so the “global” compiler toolchain for the whole build is JDK 11.git-src/punching/production/pom.xmlyou override the compiler plugin for punching with<source>1.8</source> / <target>1.8</target>, and some child modules have their ownmaven-compiler-pluginblocks with even older targets (1.4,1.5,1.6,1.7,1.8) or newer ones (16,17) depending on the module.IntelliJ 2026.2 now does two things on Reload All Maven Projects:
Because your top-level POM effectively says “compile with JDK 11” (via
<release>11</release>), IDEA maps Maven modules back to the project JDK 11 on each reload. The per-module SDKs you set by hand in Project Structure are no longer treated as authoritative for Maven modules, so they get overwritten. That’s why all thepunching-controleur-*modules jump back to SDK 11.source/targetas language level, not as “which JDK installation to use”.The
1.4/1.6/1.8values in the variousmaven-compiler-pluginconfigs are respected for language/bytecode level, but they do not mean “use a JDK 1.4/1.6/1.8 installation for this module” – they mean “compile with JDK 11, targeting this older bytecode level”. That’s why changing those values alone doesn’t give you a stable JDK 8 SDK in the IDE.So with the current importer, there’s no way to keep manual “JDK 1.8 SDK” assignments for Maven modules stable across a Maven reload: the Maven model always wins and re-applies JDK 11.
Given your constraints, you effectively have two options:
1: Let everything compile with JDK 11, keep old
targetvaluesThis is the least intrusive and closest to what Maven already describes:
maven-compiler-pluginconfig (<source>/<target>or<release>) as-is.punching-controleur-*modules is set correctly (8 or below). As long as that’s true, the fact that the SDK is “11” is usually harmless and matches whatmvndoes.If the build errors you mentioned (“UTF-8” / JDK 1.8 errors) only appeared because of the bad
ADDITIONAL_OPTIONS_OVERRIDEblock incompiler.xml, then once that part is under control this setup should work, even with SDK 11.2: Model the multiple JDKs in Maven with toolchains, and delegate builds to Maven
If certain modules must be compiled by a real JDK 8 (not just target 1.8 under JDK 11), that information needs to live in Maven, not only in IDEA:
~/.m2/toolchains.xml) with entries for JDK 8 and JDK 11.git-src/punching/production/pom.xmlor specificpunching-controleur-*POMs), wiremaven-toolchains-plugin+maven-compiler-pluginso Maven itself selects the JDK 8 toolchain for those modules.This gives you reliable JDK selection for the actual compilation without fighting the IDE’s rewrite of module SDKs.