Repository: quarkusio/quarkus
Issue: NoClassDefFoundError for multi-module dependency in Vert.x reactive routes when using Maven quarkusDev 

**Describe the bug**
A multi-module maven project contains two submodules _mod1_ and _mod2_, where _mod2_ depends on _mod1_.
When running _mod2_ in dev mode, `NoClassDefFoundError` occurs for a route class from _mod1_.

The error does not occur when the application is built with `mvn package` and run with `java -jar mod2/target/mod2-0.0.1-SNAPSHOT-runner.jar`.

**Expected behavior**
The application should work no matter if it is run in dev mode or not.

**Actual behavior**
If the application is started with `mvn compile quarkus:dev -pl mod2`, an internal server error is returned when a request is made to a route in _mod1_. Both the log and the HTTP response contain a stacktrace:
```
2021-02-20 02:39:39,613 ERROR [io.qua.ver.htt.run.QuarkusErrorHandler] (vert.x-eventloop-thread-3) HTTP Request to /mod1/ failed, error id: d2ed3e7e-337e-4fcf-9c6e-eddc7944cecc-1: java.lang.NoClassDefFoundError: sg/wjtan/mod1/IndexPage
        at sg.wjtan.mod1.IndexPage_RouteHandler_index_279c3f7d45b3461bf7246354cb951cebf8120d77.invoke(IndexPage_RouteHandler_index_279c3f7d45b3461bf7246354cb951cebf8120d77.zig:104)
        at io.quarkus.vertx.web.runtime.RouteHandler.handle(RouteHandler.java:97)
        at io.quarkus.vertx.web.runtime.RouteHandler.handle(RouteHandler.java:22)
        at io.vertx.ext.web.impl.RouteState.handleContext(RouteState.java:1038)
        at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:101)
        at io.vertx.ext.web.impl.RoutingContextImpl.next(RoutingContextImpl.java:132)
        at io.quarkus.vertx.http.runtime.VertxHttpRecorder$17.handle(VertxHttpRecorder.java:1121)
        at io.quarkus.vertx.http.runtime.VertxHttpRecorder$17.handle(VertxHttpRecorder.java:1092)
        at io.vertx.ext.web.impl.RouteState.handleContext(RouteState.java:1038)
        at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:137)
        at io.vertx.ext.web.impl.RoutingContextImpl.next(RoutingContextImpl.java:132)
        at io.quarkus.vertx.http.runtime.VertxHttpRecorder$4.handle(VertxHttpRecorder.java:333)
        at io.quarkus.vertx.http.runtime.VertxHttpRecorder$4.handle(VertxHttpRecorder.java:311)
        at io.vertx.ext.web.impl.RouteState.handleContext(RouteState.java:1038)
        at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:137)
        at io.vertx.ext.web.impl.RoutingContextImpl.next(RoutingContextImpl.java:132)
        at io.quarkus.vertx.http.runtime.devmode.VertxHttpHotReplacementSetup$3.handle(VertxHttpHotReplacementSetup.java:86)
        at io.quarkus.vertx.http.runtime.devmode.VertxHttpHotReplacementSetup$3.handle(VertxHttpHotReplacementSetup.java:75)
        at io.vertx.core.impl.ContextImpl.lambda$null$0(ContextImpl.java:327)
        at io.vertx.core.impl.ContextImpl.executeTask(ContextImpl.java:366)
        at io.vertx.core.impl.EventLoopContext.lambda$executeAsync$0(EventLoopContext.java:38)
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.ClassNotFoundException: sg.wjtan.mod1.IndexPage
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
        at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:428)
        at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:378)
        ... 28 more
```

**To Reproduce**

Steps to reproduce the behavior:
1. Fetch to sample project from https://github.com/wjtan/quarkus-multi-web
2. Compile the project `mvn install`
2. Start the application using `mvn compile quarkus:dev -pl mod2`
3. Open the URL http://localhost:8080/mod1

**Environment (please complete the following information):**
 - Output of `uname -a` or `ver`: Windows 10 20H2
 - Output of `java -version`: java 11.0.10 2021-01-19 LTS
 - GraalVM version (if different from Java): n/a
 - Quarkus version or git rev: 1.12.0.Final
 - Build tool (ie. output of `mvnw --version` or `gradlew --version`):  Maven 3.6.3


Changed files:
extensions/vertx-web/deployment/src/main/java/io/quarkus/vertx/web/deployment/VertxWebProcessor.java

diff --git a/extensions/vertx-web/deployment/src/main/java/io/quarkus/vertx/web/deployment/VertxWebProcessor.java b/extensions/vertx-web/deployment/src/main/java/io/quarkus/vertx/web/deployment/VertxWebProcessor.java
index 30889c74c92..add7a48d162 100644
--- a/extensions/vertx-web/deployment/src/main/java/io/quarkus/vertx/web/deployment/VertxWebProcessor.java
+++ b/extensions/vertx-web/deployment/src/main/java/io/quarkus/vertx/web/deployment/VertxWebProcessor.java
@@ -63,7 +63,7 @@
 import io.quarkus.deployment.annotations.BuildStep;
 import io.quarkus.deployment.annotations.ExecutionTime;
 import io.quarkus.deployment.annotations.Record;
-import io.quarkus.deployment.builditem.ApplicationIndexBuildItem;
+import io.quarkus.deployment.builditem.ApplicationClassPredicateBuildItem;
 import io.quarkus.deployment.builditem.FeatureBuildItem;
 import io.quarkus.deployment.builditem.GeneratedClassBuildItem;
 import io.quarkus.deployment.builditem.LaunchModeBuildItem;
@@ -231,14 +231,19 @@ void addAdditionalRoutes(
             BuildProducer<RouteDescriptionBuildItem> descriptions,
             Capabilities capabilities,
             Optional<BeanValidationAnnotationsBuildItem> beanValidationAnnotations,
-            ApplicationIndexBuildItem applicationIndex) {
+            List<ApplicationClassPredicateBuildItem> predicates) {
 
         Predicate<String> appClassPredicate = new Predicate<String>() {
             @Override
             public boolean test(String name) {
                 int idx = name.lastIndexOf(HANDLER_SUFFIX);
                 String className = idx != -1 ? name.substring(0, idx) : name;
-                return applicationIndex.getIndex().getClassByName(DotName.createSimple(className.replace("/", "."))) != null;
+                for (ApplicationClassPredicateBuildItem i : predicates) {
+                    if (i.test(className)) {
+                        return true;
+                    }
+                }
+                return false;
             }
         };
         ClassOutput classOutput = new GeneratedClassGizmoAdaptor(generatedClass, appClassPredicate);