TL;DR
You don't need that, just build to Java 8 and be happy!
Solving
You can use Maven Build Profiles for this:
https://maven.apache.org/guides/introduction/introduction-to-profiles.html
1. Set your properties to Java 11:
<properties>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.release>11</maven.compiler.release>
</properties>
2. Set your final name:
<build>
<finalName>${project.artifactId}-jdk11-${project.version}</finalName>
</build>
3. Add a profile:
<profile>
<id>jdk-8</id>
<properties>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.release>1.8</maven.compiler.release>
</properties>
<build>
<finalName>${project.artifactId}-jdk8-${project.version}</finalName>
</build>
</profile>
4. Build:
You will need to run 2 builds, one normal, and other activating the JDK 8 profile:
$ mvn ...
$ mvn ... -P jdk-8
Considerations:
- Always use JDK 11 as it can confidently build Java 8 targets;
- You don't need target and source properties, but if some plugin fails, put it back.