diff --git a/core/deployment/src/test/java/io/quarkus/deployment/util/JandexUtilTest.java b/core/deployment/src/test/java/io/quarkus/deployment/util/JandexUtilTest.java index e2b8a47b0130ca..518a550c787a7a 100644 --- a/core/deployment/src/test/java/io/quarkus/deployment/util/JandexUtilTest.java +++ b/core/deployment/src/test/java/io/quarkus/deployment/util/JandexUtilTest.java @@ -16,6 +16,8 @@ import org.jboss.jandex.Type.Kind; import org.junit.jupiter.api.Test; +import io.quarkus.commons.classloading.ClassloadHelper; + public class JandexUtilTest { private static final DotName SIMPLE = DotName.createSimple(Single.class.getName()); @@ -307,7 +309,7 @@ private static Index index(Class... classes) { for (Class clazz : classes) { try { try (InputStream stream = JandexUtilTest.class.getClassLoader() - .getResourceAsStream(clazz.getName().replace('.', '/') + ".class")) { + .getResourceAsStream(ClassloadHelper.fromClassNameToResourceName(clazz.getName()))) { indexer.index(stream); } } catch (IOException e) { diff --git a/independent-projects/bootstrap/benchmarks/src/main/java/io/quarkus/commons/benchmarks/BenchmarkClassnameToResourceName.java b/independent-projects/bootstrap/benchmarks/src/main/java/io/quarkus/commons/benchmarks/BenchmarkClassnameToResourceName.java index 3879ac294bb733..c3974b21551c22 100644 --- a/independent-projects/bootstrap/benchmarks/src/main/java/io/quarkus/commons/benchmarks/BenchmarkClassnameToResourceName.java +++ b/independent-projects/bootstrap/benchmarks/src/main/java/io/quarkus/commons/benchmarks/BenchmarkClassnameToResourceName.java @@ -1,6 +1,8 @@ package io.quarkus.commons.benchmarks; -import io.quarkus.commons.classloading.ClassloadHelper; +import java.io.IOException; +import java.util.concurrent.TimeUnit; + import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Fork; @@ -12,8 +14,7 @@ import org.openjdk.jmh.annotations.State; import org.openjdk.jmh.annotations.Warmup; -import java.io.IOException; -import java.util.concurrent.TimeUnit; +import io.quarkus.commons.classloading.ClassloadHelper; /** * We benchmark this strategy with CompilerControl.Mode.EXCLUDE as this code diff --git a/independent-projects/bootstrap/maven-resolver/pom.xml b/independent-projects/bootstrap/maven-resolver/pom.xml index 97ce31340034ce..ee02443b7e1f0e 100644 --- a/independent-projects/bootstrap/maven-resolver/pom.xml +++ b/independent-projects/bootstrap/maven-resolver/pom.xml @@ -33,6 +33,10 @@ + + io.quarkus + quarkus-classloader-commons + io.smallrye.beanbag smallrye-beanbag-maven diff --git a/independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/options/BootstrapMavenOptions.java b/independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/options/BootstrapMavenOptions.java index 5ef8f4297a0d44..3a2999a7da632e 100644 --- a/independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/options/BootstrapMavenOptions.java +++ b/independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/options/BootstrapMavenOptions.java @@ -22,6 +22,7 @@ import org.apache.maven.shared.utils.cli.CommandLineUtils; import io.quarkus.bootstrap.util.PropertyUtils; +import io.quarkus.commons.classloading.ClassloadHelper; /** * This class resolves relevant Maven command line options in case it's called @@ -256,7 +257,7 @@ private static Map invokeParser(ClassLoader cl, String[] args) t * classpath of the context classloader */ public static Path getClassOrigin(Class cls) throws IOException { - return getResourceOrigin(cls.getClassLoader(), cls.getName().replace('.', '/') + ".class"); + return getResourceOrigin(cls.getClassLoader(), ClassloadHelper.fromClassNameToResourceName(cls.getName())); } public static Path getResourceOrigin(ClassLoader cl, final String name) throws IOException { diff --git a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/maven/utilities/MojoUtils.java b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/maven/utilities/MojoUtils.java index e7a33a355a384a..b7ad89af505172 100644 --- a/independent-projects/tools/devtools-common/src/main/java/io/quarkus/maven/utilities/MojoUtils.java +++ b/independent-projects/tools/devtools-common/src/main/java/io/quarkus/maven/utilities/MojoUtils.java @@ -28,6 +28,7 @@ import io.fabric8.maven.Maven; import io.fabric8.maven.XMLFormat; +import io.quarkus.commons.classloading.ClassloadHelper; /** * @author kameshs @@ -319,7 +320,7 @@ public static String[] readGavFromSettingsGradle(ByteArrayInputStream buildFileI * classpath of the context classloader */ public static Path getClassOrigin(Class cls) throws IOException { - return getResourceOrigin(cls.getClassLoader(), cls.getName().replace('.', '/') + ".class"); + return getResourceOrigin(cls.getClassLoader(), ClassloadHelper.fromClassNameToResourceName(cls.getName())); } public static Path getResourceOrigin(ClassLoader cl, final String name) throws IOException {