Repository: quarkusio/quarkus
Issue: Qute: "No template found for path ..." only in Eclipse IDE

### Describe the bug

When I run a Quarkus app from within Eclipse, I get an io.quarkus.qute.TemplateException that the specified template can not be found.
On the other hand, if I run `./gradlew quarkusDev` from the command line, it works perfectly. Also when I build the app and then run the compiled quarkus-app.jar

### Expected behavior

Quarkus (or Eclipse) should find the existing template in `src/main/resources/templates`.

### Actual behavior

A "io.quarkus.qute.TemplateException: No template found for path ..." exception is thrown.

### How to Reproduce?

I created a minimal project here https://github.com/mailq/qutebug

Run it as Java Application from within the Eclipse IDE (2021-12) and experience the exception.

Run it with `./gradlew quarkusDev` at the command prompt and you get the correct output from the rendered template.

### Output of `uname -a` or `ver`

Linux desktop 5.11.0-41-generic #45-Ubuntu SMP Fri Nov 5 11:37:01 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

### Output of `java -version`

openjdk version "17.0.1" 2021-10-19 OpenJDK Runtime Environment (build 17.0.1+12-Ubuntu-121.04) OpenJDK 64-Bit Server VM (build 17.0.1+12-Ubuntu-121.04, mixed mode, sharing)

### GraalVM version (if different from Java)

none

### Quarkus version or git rev

2.6.0-Final, wasn't also working with 2.5

### Build tool (ie. output of `mvnw --version` or `gradlew --version`)

Gradle 7.3.2 (wrapper)

### Additional information

Eclipse IDE for Enterprise Java and Web Developers (includes Incubating components)
Version: 2021-12 (4.22.0)
Build id: 20211202-1639

Changed files:
independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/IDELauncherImpl.java

diff --git a/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/IDELauncherImpl.java b/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/IDELauncherImpl.java
index 3f90687f610..b0390e2bc91 100644
--- a/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/IDELauncherImpl.java
+++ b/independent-projects/bootstrap/core/src/main/java/io/quarkus/bootstrap/IDELauncherImpl.java
@@ -4,6 +4,7 @@
 import io.quarkus.bootstrap.app.CuratedApplication;
 import io.quarkus.bootstrap.app.QuarkusBootstrap;
 import io.quarkus.bootstrap.model.ApplicationModel;
+import io.quarkus.bootstrap.model.PathsCollection;
 import io.quarkus.bootstrap.resolver.maven.BootstrapMavenContext;
 import io.quarkus.bootstrap.resolver.maven.MavenArtifactResolver;
 import io.quarkus.bootstrap.util.BootstrapUtils;
@@ -15,6 +16,8 @@
 import java.io.Closeable;
 import java.io.IOException;
 import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -45,12 +48,20 @@ public static Closeable launch(Path classesDir, Map<String, Object> context) {
                 final ApplicationModel quarkusModel = BuildToolHelper.enableGradleAppModelForDevMode(classesDir);
                 context.put(BootstrapConstants.SERIALIZED_APP_MODEL, BootstrapUtils.serializeAppModel(quarkusModel, false));
 
-                final Path launchingModulePath = quarkusModel.getApplicationModule().getMainSources().getSourceDirs().iterator()
+                ArtifactSources mainSources = quarkusModel.getApplicationModule().getMainSources();
+
+                final Path launchingModulePath = mainSources.getSourceDirs().iterator()
                         .next().getOutputDir();
 
+                List<Path> applicationRoots = new ArrayList<>();
+                applicationRoots.add(launchingModulePath);
+                for (SourceDir resourceDir : mainSources.getResourceDirs()) {
+                    applicationRoots.add(resourceDir.getOutputDir());
+                }
+
                 // Gradle uses a different output directory for classes, we override the one used by the IDE
                 builder.setProjectRoot(launchingModulePath)
-                        .setApplicationRoot(launchingModulePath)
+                        .setApplicationRoot(PathsCollection.from(applicationRoots))
                         .setTargetDirectory(quarkusModel.getApplicationModule().getBuildDir().toPath());
 
                 for (ResolvedDependency dep : quarkusModel.getDependencies()) {