JPMS Attic


Java Modules


Modular Java Kotlin Bazel Gradle Maven

Build status Apache 2.0 License


JPMS Attic Repository

Latest Release: 1.0.9

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.

Pending PRs

Tracking issue here provides the best tracker. Once these PRs are merged and changes are released, this repo becomes obsolete.

What’s in the box?

How do I use it?

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.

Maven

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>

Gradle

Groovy
repositories {
    maven {
        url "https://jpms.pkg.st/repository"
    }
}
Kotlin
repositories {
    maven {
        url = uri("https://jpms.pkg.st/repository")
    }
}

Libraries

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 Central
com.google.guava:guava JPMS
com.google.j2objc:j2objc-annotations Central
com.google.protobuf:protobuf-java JPMS
com.google.protobuf:protobuf-javalite JPMS
com.google.protobuf:protobuf-util JPMS
com.google.protobuf:protobuf-kotlin JPMS
com.google.protobuf:protobuf-kotlin-lite JPMS
io.leangen.geantyref:geantyref Central
org.apache.maven.resolver:maven-resolver-api JPMS
org.apache.maven.resolver:maven-resolver-connector-basic JPMS
org.apache.maven.resolver:maven-resolver-generator-gnupg JPMS
org.apache.maven.resolver:maven-resolver-impl JPMS
org.apache.maven.resolver:maven-resolver-named-locks JPMS
org.apache.maven.resolver:maven-resolver-spi JPMS
org.apache.maven.resolver:maven-resolver-transport-classpath JPMS
org.apache.maven.resolver:maven-resolver-transport-file JPMS
org.apache.maven.resolver:maven-resolver-transport-jdk JPMS
org.apache.maven.resolver:maven-resolver-transport-jetty JPMS
org.apache.maven.resolver:maven-resolver-util JPMS
org.checkerframework:checker-qual JPMS
org.jetbrains.kotlinx:kotlinx-collections-immutable JPMS
org.reactivestreams:reactive-streams JPMS

Using the modules

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.apache.maven.resolver:maven-resolver-api org.apache.maven.resolver
org.apache.maven.resolver:maven-resolver-connector-basic org.apache.maven.resolver.connector.basic
org.apache.maven.resolver:maven-resolver-generator-gnupg org.apache.maven.resolver.generator.gnupg
org.apache.maven.resolver:maven-resolver-impl org.apache.maven.resolver.impl
org.apache.maven.resolver:maven-resolver-named-locks org.apache.maven.resolver.named
org.apache.maven.resolver:maven-resolver-spi org.apache.maven.resolver.spi
org.apache.maven.resolver:maven-resolver-transport-classpath org.apache.maven.resolver.transport.classpath
org.apache.maven.resolver:maven-resolver-transport-file org.apache.maven.resolver.transport.file
org.apache.maven.resolver:maven-resolver-transport-jdk org.apache.maven.resolver.transport.jdk
org.apache.maven.resolver:maven-resolver-transport-jetty org.apache.maven.resolver.transport.jetty
org.apache.maven.resolver:maven-resolver-util org.apache.maven.resolver.util
org.checkerframework:checker-qual org.checkerframework.checker.qual
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.

BOMs & Catalogs

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 JPMS
Gradle Catalog dev.javamodules:jpms-catalog JPMS
Gradle Platform dev.javamodules:jpms-platform JPMS

Using the Version Catalog

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.9")
    }
  }
}

build.gradle.kts:

dependencies {
  api(attic.guava)
}

Using the Gradle Platform

To use the Gradle Platform to constrain your versions, map the repository as usual, then:

dependencies {
  api(platform("dev.javamodules:jpms-platform:1.0.9"))
}

The Version Catalog also provides a mapping:

dependencies {
  api(platform(attic.javamodules.platform))
}

Limitations

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

Sample projects are provided in the samples directory, which show how to hook up the repository and override libraries.

Coming soon

Future badges

SLSA SPDX

Licensing

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.