### CI Link

https://gradle-enterprise.elastic.co/s/awqa2s2dkorzs

### Repro line

./gradlew :libs:elasticsearch-core:test --tests "org.elasticsearch.jdk.JarHellTests.testNonJDKModuleURLs" -Dtests.seed=97CC4411A902D87D -Dtests.iters=2

### Does it reproduce?

Yes

### Applicable branches

main

### Failure history

_No response_

### Failure excerpt

> Task :libs:elasticsearch-core:test FAILED

REPRODUCE WITH: ./gradlew ':libs:elasticsearch-core:test' --tests "org.elasticsearch.jdk.JarHellTests.testNonJDKModuleURLs {seed=[97CC4411A902D87D:DC845B02DBE2253]}" -Dtests.seed=97CC4411A902D87D -Dtests.locale=nl -Dtests.timezone=Pacific/Majuro -Druntime.java=20

org.elasticsearch.jdk.JarHellTests > testNonJDKModuleURLs {seed=[97CC4411A902D87D:DC845B02DBE2253]} FAILED
    java.nio.file.InvalidPathException: File name: testNonJDKModuleURLs {seed=[97CC4411A902D87D:DC845B02DBE2253]}-001 contains a reserved character: :: testNonJDKModuleURLs {seed=[97CC4411A902D87D:DC845B02DBE2253]}-001
        at __randomizedtesting.SeedInfo.seed([97CC4411A902D87D:DC845B02DBE2253]:0)
        at org.apache.lucene.tests.mockfile.WindowsPath.checkInvalidPath(WindowsPath.java:58)
        at org.apache.lucene.tests.mockfile.WindowsPath.resolve(WindowsPath.java:42)
        at org.apache.lucene.tests.mockfile.FilterPath.resolve(FilterPath.java:151)
        at java.base/java.nio.file.Path.resolve(Path.java:516)
        at org.apache.lucene.tests.mockfile.FilterPath.resolve(FilterPath.java:156)
        at org.apache.lucene.tests.util.TestRuleTemporaryFilesCleanup.createTempDir(TestRuleTemporaryFilesCleanup.java:286)
        at org.apache.lucene.tests.util.LuceneTestCase.createTempDir(LuceneTestCase.java:3065)
        at org.elasticsearch.jdk.JarHellTests.testNonJDKModuleURLs(JarHellTests.java:124)

libs/core/src/test/java/org/elasticsearch/jdk/JarHellTests.java
Path dir2 = createTempDir();
        Set<URL> dirs = asSet(makeJar(dir1, "foo.jar", null, "DuplicateClass.class"), makeFile(dir2, "DuplicateClass.class"));
        try {
            JarHell.checkJarHell(dirs, logger::debug);
            fail("did not get expected exception");
        } catch (IllegalStateException e) {
            assertTrue(e.getMessage().contains("jar hell!"));
            assertTrue(e.getMessage().contains("DuplicateClass"));
            assertTrue(e.getMessage().contains("foo.jar"));
            assertTrue(e.getMessage().contains(dir2.toString()));
        }
    }
    public void testNonJDKModuleURLs() throws Throwable {
        var bootLayer = ModuleLayer.boot();
        Path fooDir = createTempDir(getTestName());
        Path fooJar = PathUtils.get(makeJar(fooDir, "foo.jar", null, "p/Foo.class").toURI());
        var fooConfiguration = bootLayer.configuration().resolve(ModuleFinder.of(), ModuleFinder.of(fooJar), List.of("foo"));
        Set<URL> urls = JarHell.nonJDKModuleURLs(fooConfiguration).collect(Collectors.toSet());
        assertThat(urls.size(), equalTo(1));
        assertThat(urls.stream().findFirst().get().toString(), endsWith("foo.jar"));
        Path barDir = createTempDir();
        Path barJar = PathUtils.get(makeJar(barDir, "bar.jar", null, "q/Bar.class").toURI());
        var barConfiguration = fooConfiguration.resolve(ModuleFinder.of(), ModuleFinder.of(barJar), List.of("bar"));
        urls = JarHell.nonJDKModuleURLs(barConfiguration).collect(Collectors.toSet());
        assertThat(urls.size(), equalTo(2));
        assertThat(urls.stream().map(URL::toString).toList(), hasItems(endsWith("foo.jar"), endsWith("bar.jar")));
    }
    public void testWithinSingleJar() throws Exception {