Skip to content

Maven clean build failure when maven.build.cache.failFast=true #220

Open
@radughiorma

Description

@radughiorma

Affected version

1.2.0

Bug description

Maven clean works and build is in success.

    mvn clean -Dmaven.build.cache.failFast=false
    [INFO] Loading cache configuration from [EDITED]\build-cache-clean-issue\.mvn\maven-build-cache-config.xml
    [INFO] Using XX hash algorithm for cache
    [INFO] Scanning for projects...
    [INFO] 
    [INFO] ----------------< com.example:build-cache-clean-issue >-----------------
    [INFO] Building build-cache-clean-issue 1.0-SNAPSHOT
    [INFO]   from pom.xml
    [INFO] --------------------------------[ jar ]---------------------------------
    [INFO] 
    [INFO] --- clean:3.4.0:clean (default-clean) @ build-cache-clean-issue ---
    [INFO] Deleting [EDITED]\build-cache-clean-issue\target
    [INFO] Cannot save project in cache, skipping
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time:  0.242 s
    [INFO] Finished at: 2025-06-07T11:19:03+03:00
    [INFO] ------------------------------------------------------------------------

Maven clean fails when

build-cache-clean-issue.zip

    mvn clean -Dmaven.build.cache.failFast=true
    [INFO] Loading cache configuration from [EDITED]\build-cache-clean-issue\.mvn\maven-build-cache-config.xml
    [INFO] Using XX hash algorithm for cache
    [INFO] Scanning for projects...
    [INFO]
    [INFO] ----------------< com.example:build-cache-clean-issue >-----------------
    [INFO] Building build-cache-clean-issue 1.0-SNAPSHOT
    [INFO]   from pom.xml
    [INFO] --------------------------------[ jar ]---------------------------------
    [INFO]
    [INFO] --- clean:3.4.0:clean (default-clean) @ build-cache-clean-issue ---
    [INFO] Deleting [EDITED]\build-cache-clean-issue\target
    [INFO] Cannot save project in cache, skipping
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time:  0.246 s
    [INFO] Finished at: 2025-06-07T11:07:04+03:00
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to restore project[com.example:build-cache-clean-issue] from cache, failing build.
    [ERROR]
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    
    Process finished with exit code 1

Why is cache report created by maven clean goal?

maven-incremental

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions