From 071af3ced4cee00772b17ac93679e6b81be2761a Mon Sep 17 00:00:00 2001 From: Rafael Winterhalter Date: Thu, 19 Dec 2024 12:29:21 +0100 Subject: [PATCH] Allow build to pass without exposed module jar files. --- .../dynamic/ClassFileLocatorForModuleFileTest.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/byte-buddy-dep/src/test/java/net/bytebuddy/dynamic/ClassFileLocatorForModuleFileTest.java b/byte-buddy-dep/src/test/java/net/bytebuddy/dynamic/ClassFileLocatorForModuleFileTest.java index 5017b39083..35066f614a 100644 --- a/byte-buddy-dep/src/test/java/net/bytebuddy/dynamic/ClassFileLocatorForModuleFileTest.java +++ b/byte-buddy-dep/src/test/java/net/bytebuddy/dynamic/ClassFileLocatorForModuleFileTest.java @@ -10,6 +10,7 @@ import java.io.Closeable; import java.io.File; import java.io.FileOutputStream; +import java.util.logging.Logger; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; import java.util.zip.ZipOutputStream; @@ -71,7 +72,13 @@ public void testZipFileClosable() throws Exception { @Test @JavaVersionRule.Enforce(9) public void testBootJar() throws Exception { - ClassFileLocator classFileLocator = ClassFileLocator.ForModuleFile.ofBootPath(); + ClassFileLocator classFileLocator; + try { + classFileLocator = ClassFileLocator.ForModuleFile.ofBootPath(); + } catch (IllegalStateException exception) { + Logger.getLogger("net.bytebuddy").info("Module boot path not available as jmod files"); + return; + } try { assertThat(classFileLocator.locate(Object.class.getName()).isResolved(), is(true)); } finally {