quarkusio/quarkus · error · GradleException

The project has no output yet, this should not happen as bui

Error message

The project has no output yet, this should not happen as build should have been executed first. Does the project have any source files?

What it means

After confirming sources exist, startDev checks that compiled classes output exists (classesExist()). If the project has sources but no build output, dev mode aborts because quarkusDev expects the Gradle build/classes task to have run first. This normally means the build task did not execute or produced no output.

Source

Thrown at devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusDev.java:349

    @SuppressWarnings("unused")
    @Option(description = "Sets test class or method name to be included (for continuous testing), '*' is supported.", option = "tests")
    public void setTests(List<String> tests) {
        getTests().set(tests);
    }

    @Inject
    public abstract ExecOperations getExecOperations();

    @TaskAction
    public void startDev() {
        if (!sourcesExist()) {
            throw new GradleException(
                    "At least one source directory (e.g. src/main/java, src/main/kotlin) should contain sources before starting Quarkus in dev mode when using Gradle. "
                            + "Please initialize your project a bit further before restarting Quarkus in dev mode.");
        }

        if (!classesExist()) {
            throw new GradleException("The project has no output yet, " +
                    "this should not happen as build should have been executed first. " +
                    "Does the project have any source files?");
        }
        AnalyticsService analyticsService = new AnalyticsService(FileLocationsImpl.INSTANCE,
                new GradleMessageWriter(getLogger()));
        analyticsService.buildAnalyticsUserInput((String prompt) -> {
            System.out.print(prompt);
            try (Scanner scanner = new Scanner(new FilterInputStream(System.in) {
                @Override
                public void close() throws IOException {
                    //don't close System.in!
                }
            })) {
                return scanner.nextLine();
            } catch (Exception e) {
                getLogger().debug("Failed to collect user input for analytics", e);
                return "";
            }

View on GitHub (pinned to e1c734241f)

Solutions

  1. Run ./gradlew classes (or the full build) before/independently of quarkusDev, then retry
  2. If using a custom source set output, restore the convention or configure the plugin accordingly
  3. Check for earlier compile errors in the Gradle log that prevented class output
  4. Run ./gradlew clean quarkusDev to force a fresh build+dev cycle

Example fix

// before
./gradlew quarkusDev   # right after a clean
// after
./gradlew classes quarkusDev # or just rerun: the task normally depends on build
Defensive patterns

Strategy: validation

Validate before calling

File classes = new File("build/classes/java/main");
if (!classes.isDirectory() || Objects.requireNonNull(classes.list()).length == 0) {
    // run the build first
    new ProcessBuilder("./gradlew", "classes").inheritIO().start().waitFor();
}

Prevention

When it happens

Trigger: classesExist() returns false despite sources existing — the classes output directory (build/classes/...) is missing or empty when the quarkusDev task action runs.

Common situations: A previous ./gradlew clean removed output and quarkusDev was invoked without rebuilding; compile task was skipped/failed silently via misconfiguration; the module's main source set output configured to a non-standard location.

Related errors


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