I basically have the same question as this How to run build twice so that I can get two artifacts using different dependencies? with a couple of additions.
Can this be configured by a environment variable? We want to have multiple versions of Java on the machines and be able to choose which Java to use based on an environment variable. Also, we need to keep the artifacts separate as there are some conflicts, but in my research I've seen this is possible. (If not please point that out)