I created a small Vaadin Addon with the Vaadin Addon Starter. The Addon shows a process line.
See this Git-Repo for the source-code https://github.com/berndklb/vaadin-progress-line
@CssImport("./styles/progress-line.css")
public class ProgressLine extends Composite<FlexLayout> implements HasItems<String>
{
private LinkedList<String> items;
private String active;
private LinkedList<ItemLabel> itemLabels = new LinkedList<>();
private FlexLayout progressLayout;
private Span lblHeadline;
public ProgressLine(String label, List<String> items, String active) {
super();
this.items = new LinkedList<>(items);
this.active = active;
this.buildUI(label);
}
...
}
If I add the maven dependency to my Vaadin Application (https://github.com/berndklb/vaadin-bugs/tree/bug/addon_css_import) and tries to start the Spring Boot Project, I get the following exception:
Failed to find the following css files in the `node_modules` or `D:\Repos\my-bug-project\frontend` directory tree:
- ./styles/progress-line.css
Check that they exist or are installed. If you use a custom directory for your resource files instead of the default `frontend` folder then make sure it's correctly configured (e.g. set 'vaadin.frontend.frontend.folder' property)
The progress-line.css can not be found, because it is inside the addon jar. If I remove the @CSSImport from ProgressLine.java I can use the Addon in the webapplication.
So what is the way to create an addon and use it another webapp? Is there any documentation about this?