How compile a maven project using different jdk with profiles? I would like specify different profiles in my POM file, and run command mvn with profile name. Help me, I'm novice. A complete example would be ideal.
Thanks.
How compile a maven project using different jdk with profiles? I would like specify different profiles in my POM file, and run command mvn with profile name. Help me, I'm novice. A complete example would be ideal.
Thanks.
You can use toolchains - see the Guide to Using Toolchains
Basically this is what you do:
${user.home}/.m2/toolchains.xml
filemaven-toolchain-plugin
from phase validate
(goal toolchain
)That's it.
Note that toolchains work only with certain "toolchains-aware" plugins.
(unfortunately I have no complete example right now)