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

Maven targets use wrong jars when Flow version has been overridden #19009

Open
Artur- opened this issue Mar 21, 2024 · 0 comments
Open

Maven targets use wrong jars when Flow version has been overridden #19009

Artur- opened this issue Mar 21, 2024 · 0 comments

Comments

@Artur-
Copy link
Member

Artur- commented Mar 21, 2024

Description of the bug

If you create an application using Vaadin 24 alpha 15 and override the Flow version from alpha22 to alpha23, then mvn vaadin:build-frontend will generate package.json using Flow alpha22 and not alpha23 (e.g. @babel/preset-react will be ^7 and not 7.23.3).

This apparently happens because that the class loader created using the URLs from the project compile path (these URLs are correct and include Flow alpha 23) is set to use the context class loader as the parent class loader here:

classLoader = new URLClassLoader(urls,
Thread.currentThread().getContextClassLoader());

Now the context class loader apparently contains the plugin dependencies and as the plugin was built using Flow alpha22, it contains a reference to that. Class loader specs also say that any class loader should first try the parent class loader, so when trying to find e.g. com/vaadin/flow/server/frontend/dependencies/vite/package.json then the created class loader will first consult the parent, which finds flow-server alpha22 and returns the URL to the resource.

Expected behavior

The project classpath would be used, not the classpath used to create the plugin

Minimal reproducible example

New project + Flow override, as described

Versions

  • Vaadin / Flow version:
  • Java version:
  • OS version:
  • Browser version (if applicable):
  • Application Server (if applicable):
  • IDE (if applicable):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🔖 Low Priority (P3)
Development

No branches or pull requests

2 participants