Latest Release:
1.0.10
This repository provides sub-module library overrides for popular Java libraries which don’t yet provide JPMS support (at least until some PRs are merged!). There is a Maven repository which contains these artifacts, too, so you can safely use them in your projects.
Tracking issue here provides the best tracker. Once these PRs are merged and changes are released, this repo becomes obsolete.
com.google.guava
: Google Guava is Google’s core Java commons, used throughout Google’s code and the
wider JVM ecosystem. Guava is an immensely popular artifact, with tons of fantastic utilities. JPMS support is in
draft.
com.google.protobuf
: Protocol Buffers (a.k.a., protobuf) are Google’s language-neutral,
platform-neutral, extensible mechanism for serializing structured data. JPMS support is in draft.
kotlinx.collections.immutable
: KotlinX Immutable Collections is a library provided as part of the
Kotlin Extensions suite, maintained by the JetBrains team. It provides immutable and persistent collection types in
Kotlin. JPMS support is in draft, but not yet merged or released.
org.reactivestreams
: Reactive Streams is a universal JVM API for building reactive software in an
implementation-agnostic manner.
Add this domain as a repository within any JVM build tool: Maven, Gradle, Bazel, sbt. For example:
[!NOTE] Filing issues: Please file issues for this repo on
elide-dev/jpms
.
In a pom.xml
:
<repositories>
<repository>
<id>jpms-attic</id>
<name>JPMS Attic</name>
<url>https://jpms.pkg.st/repository</url>
</repository>
</repositories>
In a settings.xml
:
<profiles>
<profile>
<id>jpms-attic</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>pkgst-jpms</id>
<name>Pkgst JPMS</name>
<url>https://jpms.pkg.st/repository</url>
</repository>
</repositories>
</profile>
</profiles>
repositories {
maven {
url "https://jpms.pkg.st/repository"
}
}
repositories {
maven {
url = uri("https://jpms.pkg.st/repository")
}
}
You should use a JPMS-enabled library version which has no conflict with Maven Central. Reference the table below to pick a library.
Libraries marked Central
have seen releases in Maven Central, and so are no longer needed through this repository.
Coordinate | Version |
---|---|
com.google.errorprone:error_prone_annotations |
|
com.google.guava:guava |
|
com.google.j2objc:j2objc-annotations |
|
com.google.protobuf:protobuf-java |
|
com.google.protobuf:protobuf-javalite |
|
com.google.protobuf:protobuf-util |
|
com.google.protobuf:protobuf-kotlin |
|
com.google.protobuf:protobuf-kotlin-lite |
|
io.leangen.geantyref:geantyref |
|
org.apache.maven.resolver:maven-resolver-util |
|
org.jetbrains.kotlinx:kotlinx-collections-immutable |
|
org.reactivestreams:reactive-streams |
Use the modules in your module-info.java
:
Coordinate | Module |
---|---|
com.google.errorprone:error_prone_annotations |
com.google.errorprone.annotations |
com.google.guava:guava |
com.google.common |
com.google.j2objc:j2objc-annotations |
com.google.j2objc.annotations |
com.google.protobuf:protobuf-java |
com.google.protobuf |
com.google.protobuf:protobuf-javalite |
com.google.protobuf |
com.google.protobuf:protobuf-util |
com.google.protobuf.util |
com.google.protobuf:protobuf-kotlin |
com.google.protobuf.kotlin |
com.google.protobuf:protobuf-kotlin-lite |
com.google.protobuf.kotlin |
io.leangen.geantyref:geantyref |
io.leangen.geantyref |
org.jetbrains.kotlinx:kotlinx-collections-immutable |
kotlinx.collections.immutable |
org.reactivestreams:reactive-streams |
org.reactivestreams |
By and large, where a module already had an
Automatic-Module-Name
, it has been preserved.
This repository additionally provides Maven BOM, Gradle Version Catalog, and Gradle Platform artifacts. These simplify and enforce the use of the right library versions. See below for use.
Type | Coordinate | Version |
---|---|---|
Maven BOM | dev.javamodules:jpms-bom |
|
Gradle Catalog | dev.javamodules:jpms-catalog |
|
Gradle Platform | dev.javamodules:jpms-platform |
To use the version catalog from Gradle, follow the setup steps below. These code samples are provided in Kotlin:
settings.gradle.kts
:
dependencyResolutionManagement {
repositories {
mavenCentral()
maven {
name = "jpms-attic"
url = uri("https://jpms.pkg.st/repository")
}
}
versionCatalogs {
create("attic") {
from("dev.javamodules:jpms-catalog:1.0.10")
}
}
}
build.gradle.kts
:
dependencies {
api(attic.guava)
}
To use the Gradle Platform to constrain your versions, map the repository as usual, then:
dependencies {
api(platform("dev.javamodules:jpms-platform:1.0.10"))
}
The Version Catalog also provides a mapping:
dependencies {
api(platform(attic.javamodules.platform))
}
This repo does not currently publish source or javadoc JARs. It’s not that it couldn’t, it’s just that mounting classifier-equipped JARs in local repositories is annoying.
Sample projects are provided in the samples directory, which show how to hook up the repository and override libraries.
JPMS-patched modules are tested against some popular downstream projects, to make sure there is no unexpected breakage. Here is a matrix of tested projects:
JPMS Module | Status | Tested Project(s) |
---|---|---|
Guava | ✅ Passing | Caffeine, GSON |
Protobuf | ⚠️ Issues | GSON, Bazel |
Future badges
This repo is open source, licensed under Apache 2.0. The libraries listed in this repo may have their own licenses; it is up to you to comply with these. These libraries are only published here for the purpose of early testing and development against new code; no warranty is provided of any kind.