Vaadin Flow/Spring doesn't add class with @Route annotation to the internal

Vaadin 10 with spring.

Vaadin Flow/Spring doesn’t add class with @Route annotation to the internal list of routes targets, if the class out of the package where MyApplication is located.

@SpringBootApplication
open class MyApplication {

@ComponentScan doesn’t resolve the problem.

ComponentScan will Scan the package beginning from where the annotation is placed. So this is intended.

However, you can add one or multiple basepackages.
See [here]
(https://stackoverflow.com/questions/10794587/how-to-scan-multiple-paths-using-the-componentscan-annotation)

Daniel Hons:
ComponentScan will Scan the package beginning from where the annotation is placed. So this is intended.

Sure, I know this.
I applied @ComponentScan with parameter set to value of root/parent package in other my (non-vaadin) spring based applications. Class with @Route annotation is within the package, included into root/parent package, that is leveraged as parameter of @ComponentScan. Unfortunately, @ComponentScan doesn’t pickup @Route annotations. @ComponentScan processes other spring annotations like @Component, but not @Route.

I am sorry I can’t help you with that. I have an annotation @EnableVaadin, but not sure what it’s doing.

I have resolved the issue.

// By default, classes with @Route annotation are searched in the package (and its sub-packages), where @SpringBootApplication class is located.
// Spring, Spring Boot and Component Scan http://www.springboottutorial.com/spring-boot-and-component-scan

// PRB: @ComponentScan doesn't search classes, annotated with @Route. It searches only classes with Spring annotations.
@ComponentScan("vlfsoft")
// Solution:
@EnableVaadin("vlfsoft")
@SpringBootApplication
open class PetClinicApplication {

Full code in https://github.com/vlipovetskii/ptc-10-prj