Skip to content

Replace hard-coded lookup table with on-the-fly version detection#806

Open
sormuras wants to merge 1 commit into
mainfrom
sormuras/use-jenesis-modules
Open

Replace hard-coded lookup table with on-the-fly version detection#806
sormuras wants to merge 1 commit into
mainfrom
sormuras/use-jenesis-modules

Conversation

@sormuras

@sormuras sormuras commented Jun 10, 2026

Copy link
Copy Markdown
Member

Overview

Prior to this change, a hard-coded lookup table mapping module names to download URIs was used to resolve the org.junit.start module and all other required modules in junit-source-launcher/lib/DownloadRequiredModules.java.

This change makes use of https://github.com/raphw/jenesis-modules#jenesis-module-repository to resolve modular JAR files via their name@version coordinates; still backed by Maven Central.

Note that org.jspecify needs a pin to its 1.0.0 version due to lack a compiled version in their module descriptor. Find more details here:

Also note that when a new version of JUnit is released, the index at https://github.com/raphw/jenesis-modules needs to be updated to include the version of JUnit - in order to support it in the junit-source-launcher/lib/DownloadRequiredModules.java program.

| java lib/DownloadRequiredModules.java

Downloading 1 module
org.junit.start <- https://repo.jenesis.build/module/org.junit.start/6.1.0/org.junit.start.jar...
Downloading 5 modules
org.junit.platform.console <- https://repo.jenesis.build/module/org.junit.platform.console/6.1.0/org.junit.platform.console.jar...
org.jspecify <- https://repo.jenesis.build/module/org.jspecify/1.0.0/org.jspecify.jar...
org.apiguardian.api <- https://repo.jenesis.build/module/org.apiguardian.api/1.1.2/org.apiguardian.api.jar...
org.junit.jupiter <- https://repo.jenesis.build/module/org.junit.jupiter/6.1.0/org.junit.jupiter.jar...
org.junit.platform.launcher <- https://repo.jenesis.build/module/org.junit.platform.launcher/6.1.0/org.junit.platform.launcher.jar...
Downloading 6 modules
org.junit.platform.reporting <- https://repo.jenesis.build/module/org.junit.platform.reporting/6.1.0/org.junit.platform.reporting.jar...
org.junit.jupiter.params <- https://repo.jenesis.build/module/org.junit.jupiter.params/6.1.0/org.junit.jupiter.params.jar...
org.junit.platform.engine <- https://repo.jenesis.build/module/org.junit.platform.engine/6.1.0/org.junit.platform.engine.jar...
org.junit.jupiter.api <- https://repo.jenesis.build/module/org.junit.jupiter.api/6.1.0/org.junit.jupiter.api.jar...
org.junit.platform.commons <- https://repo.jenesis.build/module/org.junit.platform.commons/6.1.0/org.junit.platform.commons.jar...
org.junit.jupiter.engine <- https://repo.jenesis.build/module/org.junit.jupiter.engine/6.1.0/org.junit.jupiter.engine.jar...
Downloading 2 modules
org.opentest4j <- https://repo.jenesis.build/module/org.opentest4j/1.3.0/org.opentest4j.jar...
org.opentest4j.reporting.tooling.spi <- https://repo.jenesis.build/module/org.opentest4j.reporting.tooling.spi/0.2.5/org.opentest4j.reporting.tooling.spi.jar...

List modules of lib directory

org.apiguardian.api@1.1.2
org.jspecify
org.junit.jupiter.api@6.1.0
org.junit.jupiter.engine@6.1.0
org.junit.jupiter.params@6.1.0
org.junit.jupiter@6.1.0
org.junit.platform.commons@6.1.0
org.junit.platform.console@6.1.0
org.junit.platform.engine@6.1.0
org.junit.platform.launcher@6.1.0
org.junit.platform.reporting@6.1.0
org.junit.start@6.1.0
org.opentest4j.reporting.tooling.spi@0.2.5
org.opentest4j@1.3.0
    14 modules

I hereby agree to the terms of the JUnit Contributor License Agreement.

@sormuras

Copy link
Copy Markdown
Member Author

This block of get() statements should also be replaced:

String junitVersion = "6.1.0";
get("lib", "org.junit.platform", "junit-platform-commons", junitVersion);
get("lib", "org.junit.platform", "junit-platform-console", junitVersion);
get("lib", "org.junit.platform", "junit-platform-engine", junitVersion);
get("lib", "org.junit.platform", "junit-platform-launcher", junitVersion);
get("lib", "org.junit.platform", "junit-platform-reporting", junitVersion);
get("lib", "org.junit.jupiter", "junit-jupiter-api", junitVersion);
get("lib", "org.junit.jupiter", "junit-jupiter-params", junitVersion);
get("lib", "org.junit.jupiter", "junit-jupiter-engine", junitVersion);
get("lib", "org.junit.vintage", "junit-vintage-engine", junitVersion);
get("lib", "junit", "junit", "4.13.2");
get("lib", "org.hamcrest", "hamcrest-core", "1.3");
get("lib", "org.apiguardian", "apiguardian-api", "1.1.2");
get("lib", "org.jspecify", "jspecify", "1.0.0");
get("lib", "org.opentest4j", "opentest4j", "1.3.0");
get("lib", "org.opentest4j.reporting", "open-test-reporting-tooling-spi", "0.2.4");
get("lib", "net.jqwik", "jqwik-api", "1.9.3");
get("lib", "net.jqwik", "jqwik-engine", "1.9.3");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant