apache/maven · error · RuntimeException

Phase interrupted

Error message

Phase interrupted

What it means

Error "Phase interrupted" thrown in apache/maven.

Source

Thrown at impl/maven-impl/src/main/java/org/apache/maven/impl/util/PhasingExecutor.java:122

        log("[{}][phase] Entering phase {}. Active tasks: {}", phaseNumber, activeTaskCount.get());
        return () -> {
            try {
                int tasksAtPhaseStart = completedTaskCount.get();
                log("[{}][phase] Closing phase {}. Waiting for all tasks to complete.", phaseNumber);
                lock.lock();
                try {
                    while (activeTaskCount.get() > 0
                            && completedTaskCount.get() - tasksAtPhaseStart < activeTaskCount.get()) {
                        taskCompletionCondition.await(100, TimeUnit.MILLISECONDS);
                    }
                } finally {
                    lock.unlock();
                }
                log("[{}][phase] Phase {} completed. Total completed tasks: {}", phaseNumber, completedTaskCount.get());
            } catch (InterruptedException e) {
                log("[{}][phase] Phase {} was interrupted.", phaseNumber);
                Thread.currentThread().interrupt();
                throw new RuntimeException("Phase interrupted", e);
            } finally {
                inPhase.set(false);
            }
        };
    }

    @Override
    public void close() {
        log("[{}][close] Closing PhasingExecutor. Active tasks: {}", activeTaskCount.get());
        if (shutdownInitiated.getAndSet(true)) {
            log("[{}][close] Shutdown already initiated. Returning.");
            return;
        }

        lock.lock();
        try {
            while (activeTaskCount.get() > 0) {
                log("[{}][close] Waiting for {} active tasks to complete.", activeTaskCount.get());

View on GitHub (pinned to e4093d4e12)

When it happens

Trigger: Thrown at impl/maven-impl/src/main/java/org/apache/maven/impl/util/PhasingExecutor.java:122 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/maven@e4093d4e12 (2026-08-21). Data as JSON: /api/errors/fe68b8075ba0ca52. Report an issue: GitHub.