quarkusio/quarkus · error · MojoExecutionException

Local dependency <module> does not appear to have any source

Error message

Local dependency <module> does not appear to have any sources

What it means

When DevMojo processes a local (workspace) module that is hot-reloadable, it needs a source parent directory. If the module reports no source paths and its SourcesDescription has null or empty resource directories, it throws MojoExecutionException with the module's compact coordinates. The module appears to have neither compiled sources nor resources.

Source

Thrown at devtools/maven/src/main/java/io/quarkus/maven/DevMojo.java:1233

                }
            }
        } else {
            projectDirectory = mavenProject.getBasedir().getPath();
            sourcePaths = mavenProject.getCompileSourceRoots().stream()
                    .map(Path::of)
                    .map(Path::toAbsolutePath)
                    .collect(Collectors.toCollection(LinkedHashSet::new));
            testSourcePaths = mavenProject.getTestCompileSourceRoots().stream()
                    .map(Path::of)
                    .map(Path::toAbsolutePath)
                    .collect(Collectors.toCollection(LinkedHashSet::new));
            activeProfiles = mavenProject.getActiveProfiles();
        }

        final Path sourceParent;
        if (sourcePaths.isEmpty()) {
            if (sources == null || sources.getResourceDirs() == null) {
                throw new MojoExecutionException(
                        "Local dependency " + module.toCompactCoords() + " does not appear to have any sources");
            }
            sourceParent = sources.getResourceDirs().iterator().next().getDir().toAbsolutePath().getParent();
        } else {
            sourceParent = sourcePaths.iterator().next().toAbsolutePath().getParent();
        }

        Path classesDir = null;
        resourcePaths = new LinkedHashSet<>();
        if (sources != null) {
            SourceDir firstSourceDir = sources.getSourceDirs().iterator().next();
            classesDir = firstSourceDir.getOutputDir().toAbsolutePath();
            if (firstSourceDir.getAptSourcesDir() != null) {
                generatedSourcesPath = firstSourceDir.getAptSourcesDir().toAbsolutePath().toString();
            }
            if (Files.isDirectory(classesDir)) {
                classesPath = classesDir.toString();
            }

View on GitHub (pinned to e1c734241f)

Solutions

  1. Ensure the dependent module actually contains src/main/java or src/main/resources sources; remove it from dependencies if it is an empty aggregator.
  2. Run mvn install on the multi-module project before starting dev mode so modules are built with correct source registrations.
  3. Fix custom sourceDirectory/resource configuration in the affected module's pom.xml.
  4. Check the module id in the message and inspect that module's build configuration directly.

Example fix

// before: dependency on an empty aggregator module
<dependency><groupId>com.acme</groupId><artifactId>acme-empty-module</artifactId></dependency>
// after: depend on the module that actually holds the sources
<dependency><groupId>com.acme</groupId><artifactId>acme-real-lib</artifactId></dependency>
Defensive patterns

Strategy: validation

Validate before calling

// before dev mode, verify each local dependency module has sources
Path mod = Path.of("../my-lib");
boolean hasSources = Files.isDirectory(mod.resolve("src/main/java"))
        || Files.isDirectory(mod.resolve("src/main/resources"));
if (!hasSources) throw new IllegalStateException("Module has no sources: " + mod);

Prevention

When it happens

Trigger: Adding a local reactor module as a dependency in dev mode where that module has no src/main/java or src/main/resources content, or the module was never properly built so no source/resource dirs were registered.

Common situations: A workspace module that only contains tests or no source at all but is still declared as a dependency; misconfigured build-helper or custom source directory in the module; freshly cloned repo where modules were not built; aggregator POM module accidentally listed as a dependency.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/e8edd23b020667cb. Report an issue: GitHub.