Classpath scan doesn't work for libraries?

Hi all,
i have a question about classpath scanning for used vaadin modules.

we use vaadin 14.1.19 with Spring boot 2.2.
I found out that some parts of vaadin flow wasn’t part od generated json file in target/frontend folder - those that were used in our library that is used in main app(vaadin button, vaadin tabs, etc.). I had to turn off the optimizeImports option in maven build to get all imports to the file. which makes the final client build pretty big.

is this known limitation or am I doing something wrong?

thank you

JS

Hi Jiri. It sounds like the classpath scanning that checks which frontend dependencies are used is not reaching some parts of the application. There is a configuration parameter that can be used for black/white listing packages that the scanning visits, but you are not using that one ? https://vaadin.com/docs/v14/flow/spring/tutorial-spring-configuration.html#special-configuration-parameters

How are the components that are not included to the bundle used in the application ? It might be something that the scanning mechanism is not picking up and we need to change.

Hi Pekka,
thank you for the tip of packages scanning. I will give it a try. For your question. We use the library as set of base let’s say templates. It includes bases of UI views for tables, details etc. These items are used in MVP based application. Main application and library don’t share package bases (com.xxx.main-app and com.xxx.library). If you have any other question, let me know.

J

Hi Pekka, I tried the white listing aproach and it didn’t work. How does the builder crawling the dependencies? It goes through all the code?

Righty. I think you should use the EnableVaadin annotation with the packages then - sorry I should have remembered this from the get-go https://github.com/vaadin/spring/blob/master/vaadin-spring/src/main/java/com/vaadin/flow/spring/annotation/EnableVaadin.java

Hi Pekka,
thank you for this. I will try it. I read about the annotation and it helps with searching for @Route annotated classes right? I mean in other than base package.

J

Hi Pekka, I tried the @EnableVaadin approach and it didn’t work too. How does the builder crawling the dependencies? It goes through all the code? Because our component library doesn’t contain Routes. Routes are only “ways” to perspectives (CRM, Billing, …) which are actualy not Components - it’s only Composite(Div) which inserts view code aquired from presenters. These views uses the component library. I hope you can understand this as it could be complicated :slight_smile:

J