Skip to content

[BUG] Kubernetes ingress CI can launch Maven with a missing or invalid wrapper JAR #8353

Closed

Description

@yangjj-iso

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

The Kubernetes ingress integration workflow invokes ./mvnw without checking that .mvn/wrapper/maven-wrapper.jar is usable. A recent job failed before project compilation with ClassNotFoundException: org.apache.maven.wrapper.MavenWrapperMain:
https://github.com/apache/shenyu/actions/runs/42376199124/job/128414196867

The checked-out merge commit was 87ef468 (PR #7960 head 2eb4c3a). The log does not include a download HTTP status or JAR inspection, so it cannot distinguish a failed download from an invalid JAR.

The repository deliberately does not track the JAR. mvnw checks only whether it is readable; on a failed wget/curl download it deletes the file but still invokes Java. A readable corrupt JAR also bypasses downloading.

Expected Behavior

Before invoking Maven, validate that the wrapper JAR contains org/apache/maven/wrapper/MavenWrapperMain.class. Reuse a valid local JAR; otherwise download wrapperUrl with bounded retries into a temporary file, validate it, and only then replace the target. If acquisition or validation fails, stop with a useful error before the Maven build step.

Steps To Reproduce

On master a6104b9:

  1. Copy mvnw and .mvn/wrapper/maven-wrapper.properties into an isolated temporary project with no wrapper JAR.
  2. Put a wget stub that exits nonzero first in PATH and run bash mvnw -v. Java is still launched and reports MavenWrapperMain ClassNotFoundException.
  3. Repeat with a readable text file at .mvn/wrapper/maven-wrapper.jar. The download is skipped and the same startup failure occurs.

Both baseline scenarios were reproduced locally. The existing preflight from integrated-test.yml was also exercised with a real loopback HTTP server: valid cached JAR, missing JAR, corrupt cached JAR, two transient 503 responses then success, invalid downloaded bytes, persistent 503, and missing wrapperUrl. All seven guard scenarios passed, including temporary-file cleanup.

Environment

ShenYu: master a6104b9c35320abf3ca183611417ea491b171ef7
Affected workflow: .github/workflows/integrated-test-k8s-ingress.yml
Failing CI: Ubuntu runner, Temurin Java 17
Local fault injection: Java 21.0.13, Bash, curl, JDK jar tool, loopback HTTP server; no Kubernetes cluster

Debug logs

Error: Could not find or load main class org.apache.maven.wrapper.MavenWrapperMain
Caused by: java.lang.ClassNotFoundException: org.apache.maven.wrapper.MavenWrapperMain

Anything else?

The regular integrated-test.yml already has an Ensure Maven wrapper JAR step with retry and validation; the Kubernetes ingress workflow does not. A focused fix can reuse that existing step without changing #7960's Eureka implementation.

This is a build-bootstrap reliability issue, not evidence of a business-code regression. The exact download failure in the linked job is unknown. I checked existing wrapper issues/PRs; #8292 changes wrapper artifact restoration in the main CI workflow, not this ingress bootstrap path.

Activity

  1. added a commit that references this issue on Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions