I want to create a multi-release JAR file for a library. I will build the MRJAR using maven - and initially it will contain Java 8 and Java 9 class files.
BUT - I do not want to maintain two separate sets of source code (e.g. in src/main/java-8
and src/main/java-9
). Is it possible to have all of the Java-9 files in e.g. src/main/java
and only the ones which differ in e.g. src/main/java-8
?
Ideally, the full source code would then be organized as:
+ pom.xml
+ src
+ main
+ java
<full java-9 source code>
+ java-8
<overriding .java files which can only be compiled with java-8>