A plugin for assisting in the creation of multi-release JAR libraries.
With the use of a multi-release JAR, a "base" version is utilized and then version-specific functionality is overridden or supplemented as necessary.
1.1.0 Supports Gradle versions [8.5, 9.0). That is any 8.5 and higher is supported until 9.0.
1.0.0 Supports Gradle versions [7.4, 8.0).
Groovy
plugins {
id 'net.kemuri9.gradle.mrjar' version '1.1.0'
}
Kotlin
plugins {
id("net.kemuri9.gradle.mrjar") version "1.1.0"
}
By applying the plugin, the mrjar
extension is registered and can be utilized to control the behavior of the project.
Additional versions of Java to compile are added with the addVersion
functionality that takes the version number and the Version
configuration block for the version specified. addVersion
can be used multiple times for the same version number, if the configuration for a Version
needs to be split across different blocks.
The "base" version can additionally be configured via the extension through the use of the baseVersion
function that takes the Version
configuration block to apply to the base version.
Examples can be found from the test case projects located in the testprojects folder
The latest javadoc can be viewed from the at https://kemuri-9.github.io/gradle-plugin-mrjar/current/
The plugin has extension points that define the behaviors for each JVM-based language. There is built in support for Java and Groovy.
Registration of new languages can be done via either of
- Registering the implementation through
net.kemuri9.gradle.mrjar.languages.LanguageSupport
ServiceLoader - Manually through the
addLanguage(LanguageSupport support)
functionality on the registeredMRJarExtension
mrjar
The existing support for a language can be replacing by manually registering the implementation through the addLanguage(LanguageSupport support)
functionality on the registered MRJarExtension
mrjar
.
Attempting to use the ServiceLoader methodology may not work as desired as ServiceLoader has no priority concept.