Skip to content

Commit 66e8060

Browse files
refactor: remove dev build fallback from runtime resolution chain
The dev build fallback (codeflash-java-runtime/target/) in _ensure_codeflash_runtime() was dead code for production users since that directory only exists in source checkouts. The resolution chain is now: 1. ~/.m2 cache (instant) 2. Maven Central (primary) 3. GitHub Releases download (production fallback) _find_runtime_jar() is kept for build_jacoco_agent_arg() and generate_jacoco_report() which need to locate the JAR by path. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7f7ce7d commit 66e8060

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

codeflash/languages/java/test_runner.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -298,15 +298,12 @@ def _ensure_codeflash_runtime(maven_root: Path, test_module: str | None) -> bool
298298
if not m2_jar.exists():
299299
# Try resolving from Maven Central first
300300
if not resolve_from_maven_central(maven_root):
301-
# Fallback 1: download from GitHub Releases (works for pip users without Maven Central)
301+
# Fallback: download from GitHub Releases (works when Maven Central is unreachable)
302302
runtime_jar = download_from_github_releases()
303-
if runtime_jar is None:
304-
# Fallback 2: find JAR in local dev build (only works from source checkout)
305-
runtime_jar = _find_runtime_jar()
306303
if runtime_jar is None:
307304
logger.error(
308305
"codeflash-runtime JAR not found. Maven Central resolution failed and "
309-
"no fallback JAR available. Generated tests will fail to compile."
306+
"GitHub Releases download failed. Generated tests will fail to compile."
310307
)
311308
return False
312309
logger.info("Installing codeflash-runtime JAR to local Maven repository from %s", runtime_jar)

0 commit comments

Comments
 (0)