Gradle
Use Cédric Champeau's mrjar plugin
plugins {
id("me.champeau.mrjar") version "0.1.1"
}
multiRelease {
targetVersions(8, 9)
}
See https://melix.github.io/mrjar-gradle-plugin/0.1/index.html for more details.
Maven
Use at least maven-compiler-plugin 3.7.1 which adds multiReleaseOutput
<configuration>
<release>9</release>
<compileSourceRoots>
<compileSourceRoot>${project.basedir}/src/main/java9</compileSourceRoot>
</compileSourceRoots>
<multiReleaseOutput>true</multiReleaseOutput>
</configuration>
Then set Multi-Release: true
in the maven-jar-plugin
<configuration>
<archive>
<manifestEntries>
<Multi-Release>true</Multi-Release>
</manifestEntries>
</archive>
</configuration>
How to add a module-info.java
todo
Top comments (0)