Why does Idea embedded maven not execute the build extension defined in the pom file when reloading maven project or load maven change?
Hi!
As the title says! I have a need to dynamically replace the dependent version. I developed a maven build extension and declared it as a build level extension in my pom file; when I use RunAnything to execute the mvn compile command, my extension is loaded and executed and the dependent version number is dynamically replaced, But when I click Load maven change, Idea will report an unrecognized dependency error (because I deliberately declare an unrecognized dependency version number in the pom, hoping to use the extension to dynamically replace when building the project)

The picture above is an example of my experiment,Then configure the build extension.

When i click load maven changes ,it fail !
But when I execute mvn compile in Run Anthing, it succeeds


Can someone tell me why this is happening? or how can i achieve my goal when Idea load maven project or load maven changes.
Thanks!
请先登录再写评论。
Hello,
There is related issue on YouTrack: https://youtrack.jetbrains.com/issue/IDEA-288322/Dependencies-Programatically-Added-via-Maven-Extensions-Are-Not-Loaded-into-IntelliJ-When-Refreshing-Project
Please follow it for updates.
Hi,Thanks Reply!
After reading the source code of Idea Community, I found that the embedded maven has removed many event handling mechanisms. Is there any other way to achieve my goal?
Unfortunately, there is no workaround at the moment. Please follow the issue on YouTrack.