Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aggregator scans built-in mvnpm jars twice for imports #41868

Closed
gsmet opened this issue Jul 12, 2024 · 1 comment · Fixed by #41966
Closed

Aggregator scans built-in mvnpm jars twice for imports #41868

gsmet opened this issue Jul 12, 2024 · 1 comment · Fixed by #41966
Assignees
Milestone

Comments

@gsmet
Copy link
Member

gsmet commented Jul 12, 2024

The standard mvnpm jars are scanned twice for imports when building the Aggregator.

The first time with scanUserProviderUrls and the second time by scanClassPath.

Given these jars are in the classpath, I'm not sure it makes sense to provide them via the UserProviderUrls.

There might be a good reason for it but I would be interested to hear it if so.

First stack trace

ZipFile.new /home/gsmet/.m2/repository/org/mvnpm/at/mvnpm/qomponent/1.0.0/qomponent-1.0.0.jar
java.util.zip.ZipFile.<init>(ZipFile.java:232)
java.util.zip.ZipFile.<init>(ZipFile.java:181)
java.util.jar.JarFile.<init>(JarFile.java:346)
jdk.internal.loader.URLClassPath$JarLoader.getJarFile(URLClassPath.java:825)
jdk.internal.loader.URLClassPath$JarLoader$1.run(URLClassPath.java:769)
jdk.internal.loader.URLClassPath$JarLoader$1.run(URLClassPath.java:762)
java.security.AccessController.doPrivileged(AccessController.java:712)
jdk.internal.loader.URLClassPath$JarLoader.ensureOpen(URLClassPath.java:761)
jdk.internal.loader.URLClassPath$JarLoader.<init>(URLClassPath.java:735)
jdk.internal.loader.URLClassPath$3.run(URLClassPath.java:499)
jdk.internal.loader.URLClassPath$3.run(URLClassPath.java:482)
java.security.AccessController.doPrivileged(AccessController.java:712)
jdk.internal.loader.URLClassPath.getLoader(URLClassPath.java:481)
jdk.internal.loader.URLClassPath.getLoader(URLClassPath.java:449)
jdk.internal.loader.URLClassPath$1.next(URLClassPath.java:345)
jdk.internal.loader.URLClassPath$1.hasMoreElements(URLClassPath.java:356)
java.net.URLClassLoader$3$1.run(URLClassLoader.java:662)
java.net.URLClassLoader$3$1.run(URLClassLoader.java:660)
java.security.AccessController.doPrivileged(AccessController.java:399)
java.net.URLClassLoader$3.next(URLClassLoader.java:659)
java.net.URLClassLoader$3.hasMoreElements(URLClassLoader.java:684)
java.lang.CompoundEnumeration.next(ClassLoader.java:2730)
java.lang.CompoundEnumeration.hasMoreElements(ClassLoader.java:2739)
io.mvnpm.importmap.Aggregator.scanUserProviderUrls(Aggregator.java:123)
io.mvnpm.importmap.Aggregator.aggregate(Aggregator.java:79)
io.mvnpm.importmap.Aggregator.aggregate(Aggregator.java:69)
io.quarkus.devui.deployment.BuildTimeContentProcessor.createIndexHtmlTemplate(BuildTimeContentProcessor.java:344)

Second stack trace

ZipFile.new /home/gsmet/.m2/repository/org/mvnpm/at/mvnpm/qomponent/1.0.0/qomponent-1.0.0.jar
java.util.zip.ZipFile.<init>(ZipFile.java:232)
java.util.zip.ZipFile.<init>(ZipFile.java:181)
java.util.jar.JarFile.<init>(JarFile.java:346)
sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.java:103)
sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:72)
sun.net.www.protocol.jar.JarFileFactory.getOrCreate(JarFileFactory.java:106)
sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:132)
sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:175)
java.net.URL.openStream(URL.java:1161)
com.fasterxml.jackson.core.TokenStreamFactory._optimizedStreamFromURL(TokenStreamFactory.java:302)
com.fasterxml.jackson.core.JsonFactory.createParser(JsonFactory.java:1245)
com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3779)
io.mvnpm.importmap.Aggregator.scanClassPath(Aggregator.java:150)
io.mvnpm.importmap.Aggregator.aggregate(Aggregator.java:80)
io.mvnpm.importmap.Aggregator.aggregate(Aggregator.java:69)
io.quarkus.devui.deployment.BuildTimeContentProcessor.createIndexHtmlTemplate(BuildTimeContentProcessor.java:344)
@gsmet
Copy link
Member Author

gsmet commented Jul 16, 2024

Hey @phillip-kruger , could you have a look when you have some time? It looks like an easy win?

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

Successfully merging a pull request may close this issue.

2 participants