-
Notifications
You must be signed in to change notification settings - Fork 168
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
Favicon not shown with JAR packaging #8705
Comments
In fact it's even worse: no need to replace the existing icon at all. |
This is a Spring issue. Then embedded servlet container is responsible for finding the resources (as static web resources). So as a result: the code in Flow tries to search the static web resource using a Servlet context and it's not able to find it (see above). I'm going to implement a workaround as well in Flow for this specific case: search the resource in classpath if it's not found via a servlet context. But this is more a hack (and it's not really correct to fix this Spring specific case in Flow repo). |
A workaround in Flow : #8808 |
Another way to solve this would be to use the approach prototyped in https://github.com/vaadin/flow/tree/webpack-workbox to enable offline routing using the webpack workbox plugin It moves all |
* Make a workaround for Spring boot run as jar Fixes #8705 * Add a unit test for implemented workaround. * Add forgotten resource * Improve variable name and add comments
* Make a workaround for Spring boot run as jar Fixes #8705 * Add a unit test for implemented workaround. * Add forgotten resource * Improve variable name and add comments
* Make a workaround for Spring boot run as jar Fixes #8705 * Add a unit test for implemented workaround. * Add forgotten resource * Improve variable name and add comments
In Vaadin 22.0.5 it's not working again (in Vaadin 14 everything is ok though) |
This is because the default icon now is in resources as well, from exampledata-4.1.0.jar dependency, which eventually breaks the workaround #8808. I used truezip-maven-plugin to remove the default icon from exampledata-4.1.0.jar archive during package step, as another temporary workaround for this situation. |
Exampledata has been fixed in 4.1.1 |
Thank you |
Description of the bug
When packaging a project as a JAR, using a custom
icon.png
insrc/main/resources/META-INF/resources/icons
, and running withjava -jar ...
, the custom favicon is not shown (it is shown correctly when running themain
method in IntelliJ IDEA, though). The problem is the same with both development and production builds.Minimal reproducible example
Go to https://vaadin.com/start/v14. Create a Spring Boot project. Replace the
icon.png
file with a custom one. Build withmvn package
. Run with ´java -jar ...`.Expected behavior
Should show the custom icon.
Actual behavior
Shows the default white circle with a blue background icon.
Versions:
The text was updated successfully, but these errors were encountered: