I’m working on a multi-module Spring project where I have two modules and one depends on the other. In the dependency module, I created a service class with the @BrowserCallable annotation, but when I run the Vaadin generation task on the main module, it doesn’t find or generate the frontend code for that service.
I already tried configuring vaadin.allowed-packages in my application.properties file and also attempted to add the META-INF/VAADIN/package.properties file, but neither approach worked. The strange thing is that when I move the exact same service class to the main module, everything works perfectly and the frontend code gets generated.
I’m running this on JDK 21 Temurin. Has anyone encountered this issue before or knows what might be causing the annotation scanner to miss services in dependency modules?
yeah, could be a classpath issue. make sure ur annotations are in the right spot. try checking ur build config and maybe add @ComponentScan for that package. should help with the issue!
that’s weird, i’ve seen this before. what build tool - gradle or maven? does the dependency module have its own vaadin plugin or just the main one? check if the annotation processor is actually scanning the jar files.
Yeah, this is a known Vaadin limitation with annotation processing across modules. The generator only scans the current module’s source directory and doesn’t properly check external JARs for @BrowserCallable annotations. I hit the same issue when breaking up a monolithic app into multiple modules. My workaround was configuring the Vaadin plugin in the main module to include the dependency module’s output directory in its scan path. Just add the dependency module’s classes directory to the plugin config. Or make sure your dependency module compiles with the Vaadin annotation processor enabled - this creates the metadata files the main module needs during generation.