I used @JavaScript in Vaadin UI, it works great in developement.
But after I use maven to package project to a single jar file.
Those java script files were not included.
Is there a way to specify in the build plugin to include those javascript files?
package com.mycompany.ui; @SpringUI(path=“/tree”) @JavaScript(“dbasTree.js”)
public class TreeUI extends UI {}
No answer for relative path of java script file for @Javascript.
Even I added the java script file to the jar file. I got this error:
Rejecting published file request for file that has not been published: dbasTree.js
So I moved the dbasTree.js to src/main/resources/static and changed to @JavaScript(“/dbasTree.js”)
Run in development, got “Rejecting published file request for file that has not been published: dbasTree.js” too.
What is the best way to use @JavaScript in Vaadin UI and how can I package the file to production jar file?
In a standard maven project resources inside src/main/resources would be packaged into the jar;
so putting your file dbasTree.js inside src/main/resources/com/mycompany/ui and annotate UI class with @JavaScript(“dbasTree.js”) should work