Skip to content

maven: surface real Ant/server error in AntExecutor failures#4911

Merged
shai-almog merged 2 commits intomasterfrom
fix-ant-executor-server-error-message
May 10, 2026
Merged

maven: surface real Ant/server error in AntExecutor failures#4911
shai-almog merged 2 commits intomasterfrom
fix-ant-executor-server-error-message

Conversation

@shai-almog
Copy link
Copy Markdown
Collaborator

Summary

  • Replace the hardcoded "!!! Unable to restart the IEHS App !!!" RuntimeException in AntExecutor (a stale boilerplate string from the file's borrowed srccodes.com template) with the actual BuildException message so the failure is clear.
  • Tee System.out/System.err during the Ant build and, on failure, scan the captured output for server-error markers (Response message from server is:, Server Detailed Error Message:, Server returned HTTP response code:) and append them to the thrown exception message. This surfaces the JSON body returned by the build server (which the build client prints to stdout but never propagates via the exception chain).
  • Console output is still forwarded to the original streams, so the user-visible build log is unchanged.
  • Add AntExecutorTest covering the marker extraction.

Motivation

A Maven Android build that hit a server-side HTTP 500 on /appsec/7.0/build/upload produced this misleading error:

Failed to execute goal ... !!! Unable to restart the IEHS App !!!

while the relevant detail — {"timestamp":"...","status":500,"error":"Internal Server Error","path":"/appsec/7.0/build/upload"} — was visible only earlier in the log and not in the exception message.

Test plan

  • mvn test -Dtest=AntExecutorTest — passes (3/3).
  • mvn compile for codenameone-maven-plugin — clean.
  • Reproduce with a triggered server build failure and confirm the response JSON shows up in the Maven failure message.

🤖 Generated with Claude Code

The catch-all in AntExecutor threw a hardcoded "Unable to restart the
IEHS App" RuntimeException for every BuildException, masking the actual
cause. When a server build fails (e.g. an HTTP 500 from the build
server) the build client prints the response body and JSON error to
stdout but does not propagate it through the exception chain, so the
maven user only saw the misleading message.

Tee stdout/stderr while the Ant project runs, scan the captured output
for the server-error markers ("Response message from server is:",
"Server Detailed Error Message:", "Server returned HTTP response
code:") and include them in the thrown RuntimeException's message
alongside the underlying BuildException's message. Console output is
still forwarded to the original streams so the user-visible build log
is unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@shai-almog
Copy link
Copy Markdown
Collaborator Author

shai-almog commented May 10, 2026

Compared 85 screenshots: 85 matched.
✅ Native iOS screenshot tests passed.

Benchmark Results

  • VM Translation Time: 0 seconds
  • Compilation Time: 195 seconds

Build and Run Timing

Metric Duration
Simulator Boot 74000 ms
Simulator Boot (Run) 1000 ms
App Install 13000 ms
App Launch 5000 ms
Test Execution 266000 ms

Detailed Performance Metrics

Metric Duration
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 native encode 1733.000 ms
Base64 CN1 encode 1363.000 ms
Base64 encode ratio (CN1/native) 0.786x (21.4% faster)
Base64 native decode 697.000 ms
Base64 CN1 decode 1031.000 ms
Base64 decode ratio (CN1/native) 1.479x (47.9% slower)
Base64 SIMD encode 534.000 ms
Base64 encode ratio (SIMD/native) 0.308x (69.2% faster)
Base64 encode ratio (SIMD/CN1) 0.392x (60.8% faster)
Base64 SIMD decode 599.000 ms
Base64 decode ratio (SIMD/native) 0.859x (14.1% faster)
Base64 decode ratio (SIMD/CN1) 0.581x (41.9% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 58.000 ms
Image createMask (SIMD on) 10.000 ms
Image createMask ratio (SIMD on/off) 0.172x (82.8% faster)
Image applyMask (SIMD off) 126.000 ms
Image applyMask (SIMD on) 55.000 ms
Image applyMask ratio (SIMD on/off) 0.437x (56.3% faster)
Image modifyAlpha (SIMD off) 129.000 ms
Image modifyAlpha (SIMD on) 67.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.519x (48.1% faster)
Image modifyAlpha removeColor (SIMD off) 306.000 ms
Image modifyAlpha removeColor (SIMD on) 67.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.219x (78.1% faster)
Image PNG encode (SIMD off) 1185.000 ms
Image PNG encode (SIMD on) 817.000 ms
Image PNG encode ratio (SIMD on/off) 0.689x (31.1% faster)
Image JPEG encode 509.000 ms

@shai-almog
Copy link
Copy Markdown
Collaborator Author

shai-almog commented May 10, 2026

Compared 90 screenshots: 90 matched.

Native Android coverage

  • 📊 Line coverage: 10.20% (5569/54613 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 8.03% (27363/340806), branch 3.68% (1201/32660), complexity 4.69% (1466/31285), method 8.23% (1203/14620), class 13.63% (268/1966)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6327 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.ClassReader – 0.00% (0/1519 lines covered)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1148 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.MethodWriter – 0.00% (0/923 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/730 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/623 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.Frame – 0.00% (0/564 lines covered)
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysJvmKt – 0.00% (0/495 lines covered)
      • kotlinx.coroutines.kotlinx.coroutines.JobSupport – 0.00% (0/423 lines covered)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 10.20% (5569/54613 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 8.03% (27363/340806), branch 3.68% (1201/32660), complexity 4.69% (1466/31285), method 8.23% (1203/14620), class 13.63% (268/1966)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6327 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.ClassReader – 0.00% (0/1519 lines covered)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1148 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.MethodWriter – 0.00% (0/923 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/730 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/623 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.Frame – 0.00% (0/564 lines covered)
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysJvmKt – 0.00% (0/495 lines covered)
      • kotlinx.coroutines.kotlinx.coroutines.JobSupport – 0.00% (0/423 lines covered)

Benchmark Results

Detailed Performance Metrics

Metric Duration
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 native encode 633.000 ms
Base64 CN1 encode 205.000 ms
Base64 encode ratio (CN1/native) 0.324x (67.6% faster)
Base64 native decode 1029.000 ms
Base64 CN1 decode 271.000 ms
Base64 decode ratio (CN1/native) 0.263x (73.7% faster)
Image encode benchmark status skipped (SIMD unsupported)

@shai-almog
Copy link
Copy Markdown
Collaborator Author

shai-almog commented May 10, 2026

Compared 90 screenshots: 90 matched.
✅ Native iOS Metal screenshot tests passed.

Benchmark Results

  • VM Translation Time: 0 seconds
  • Compilation Time: 250 seconds

Build and Run Timing

Metric Duration
Simulator Boot 92000 ms
Simulator Boot (Run) 0 ms
App Install 12000 ms
App Launch 6000 ms
Test Execution 203000 ms

Detailed Performance Metrics

Metric Duration
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 native encode 1004.000 ms
Base64 CN1 encode 1237.000 ms
Base64 encode ratio (CN1/native) 1.232x (23.2% slower)
Base64 native decode 688.000 ms
Base64 CN1 decode 923.000 ms
Base64 decode ratio (CN1/native) 1.342x (34.2% slower)
Base64 SIMD encode 465.000 ms
Base64 encode ratio (SIMD/native) 0.463x (53.7% faster)
Base64 encode ratio (SIMD/CN1) 0.376x (62.4% faster)
Base64 SIMD decode 372.000 ms
Base64 decode ratio (SIMD/native) 0.541x (45.9% faster)
Base64 decode ratio (SIMD/CN1) 0.403x (59.7% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 59.000 ms
Image createMask (SIMD on) 9.000 ms
Image createMask ratio (SIMD on/off) 0.153x (84.7% faster)
Image applyMask (SIMD off) 129.000 ms
Image applyMask (SIMD on) 51.000 ms
Image applyMask ratio (SIMD on/off) 0.395x (60.5% faster)
Image modifyAlpha (SIMD off) 147.000 ms
Image modifyAlpha (SIMD on) 52.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.354x (64.6% faster)
Image modifyAlpha removeColor (SIMD off) 134.000 ms
Image modifyAlpha removeColor (SIMD on) 59.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.440x (56.0% faster)
Image PNG encode (SIMD off) 1079.000 ms
Image PNG encode (SIMD on) 740.000 ms
Image PNG encode ratio (SIMD on/off) 0.686x (31.4% faster)
Image JPEG encode 512.000 ms

Pass an explicit UTF-8 charset to the tee PrintStreams and to
ByteArrayOutputStream.toString(). Also drop the now-unused
getConsoleLogger() helper to silence UPM_UNCALLED_PRIVATE_METHOD.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

✅ Continuous Quality Report

Test & Coverage

Static Analysis

  • SpotBugs [Report archive]
    • ByteCodeTranslator: 0 findings (no issues)
    • android: 0 findings (no issues)
    • codenameone-maven-plugin: 0 findings (no issues)
    • core-unittests: 0 findings (no issues)
    • ios: 0 findings (no issues)
  • PMD: 0 findings (no issues) [Report archive]
  • Checkstyle: 0 findings (no issues) [Report archive]

Generated automatically by the PR CI workflow.

@shai-almog shai-almog merged commit 16e63cc into master May 10, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant