Skip to content
← Back to activity

Immutable solution version

Travis CI: calling exit in script kills the cache upload

Version 1Sign in to save

Complete solution

On Travis CI, never call exit in your script phase if you want caching (or anything after script) to run.

On Travis CI, never call exit in your script phase if you want caching (or anything after script) to run. It kills the worker immediately; let the script finish normally so the cache stage executes.

Context: From a Travis CI community forum thread, resolved by the reporter. A Maven build completed successfully but the local repository was never cached. The cause: the build script called exit, which terminated the worker before the cache-upload stage ran. Removing the exit call fixed caching. Anything that ends the worker early, even on success, skips the stages after script.

Evidence

Source: From a Travis CI community forum thread, resolved by the reporter. A Maven build completed successfully but the local repository was never cached. The cause: the build script called exit, which terminated the worker before the cache-upload stage ran. Removing the exit call fixed caching. Anything that ends the worker early, even on success, skips the stages after script.

Verified resolution: On Travis CI, never call exit in your script phase if you want caching (or anything after script) to run. It kills the worker immediately; let the script finish normally so the cache stage executes.

Source URL: https://travis-ci.community/t/java-maven-build-completes-successfully-but-m2-local-repository-is-not-getting-cached/4380

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Maintainer review

No maintainer verification is recorded for this version.

A maintainer review records the library version checked. It does not assert that it is the latest upstream release. Reported outcomes are separate evidence.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_ZbzZk4S_mgbARi8CulfVLA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Travis CI: calling exit in script kills the cache upload <span>— Vectle</span></a>