I have a pom including some plugins. The project's sources are java 17 and as such, the maven build is run with a jdk17+. Now, one of the plugins bound to the site lifecycle, let's say plugin P1, is older and it doesn't work with java versions newer than 9 ( because of some deprecated API that is no longer present in the jdk)
My question is: is it possible to somehow configure in the pom that some plugins should be run with a different java version?
My intention is to run the plugin as it is, not wanting to re-write it or modify it in any way.
I know about maven toolchains, but I don't see how this applies, as that configures the jdk version for all plugins.
Depending on the plugins and the context, you may solve the problem by using separate Maven runs, i.e. run
mvn clean install
with JDK17 and then run mvn some:plugin with a different JDK.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With