SEPURI-SAI-KRISHNA opened a new pull request, #13466: URL: https://github.com/apache/seatunnel/pull/13466
Yes, glad to contribute to Apache SeaTunnel. ### Purpose of this pull request Closes #13461. `maven-wrapper.jar` is not committed, so every CI job downloads it in `mvnw`. When Maven Central answers all 5 attempts with `429 Too Many Requests` or `404 Not Found`, the job fails with `ClassNotFoundException: org.apache.maven.wrapper.MavenWrapperMain` before any test runs. #13461 lists 12 such jobs from the last two weeks. The retry added in #12468 waits about 75 seconds in total, all on the same host, and that was not enough in these jobs. Change, in `mvnw` only: when the download from the default Maven Central URL fails, the jar is downloaded from Google's mirror of Maven Central (`maven-central.storage-download.googleapis.com`, which Apache Spark's `pom.xml` lists first as its Maven Central repository). It is kept only if its SHA-256 is `46b0acdf...6bd6`, the hash of `maven-wrapper-3.1.0.jar` on Maven Central (which also matches Central's published `.sha1`). Otherwise it is removed and the job fails as before. Unchanged: - A successful download from Maven Central, and an existing `.mvn/wrapper/maven-wrapper.jar`. - A custom `wrapperUrl` in `maven-wrapper.properties`, and `MVNW_USERNAME` / `MVNW_PASSWORD`: no fallback, since those point to the user's own repository. - `mvnw.cmd`: none of the jobs in #13461 ran on Windows. The Maven distribution download is also unchanged. ### Does this PR introduce _any_ user-facing change? No. Only a failed wrapper jar download behaves differently: it tries the mirror before giving up. ### How was this patch tested? The real `mvnw` was run with `sh` (dash) in throwaway copies of the project, with fake `wget`, `curl` and `sleep` that fail the Maven Central URL on demand. Each case runs `./mvnw -v`. | Case | This PR | dev | |---|---|---| | wget, Central 429 x5, mirror serves the jar | mirror jar used, `mvnw -v` works | fails | | wget, Central 404 x5, real download from the mirror | mirror jar used, SHA-256 ok | fails | | mirror serves a wrong file | rejected and removed, job fails as before | fails | | curl, Central 429 x5 | mirror jar used | fails | | Central answers | one download, mirror never called | same | | custom `wrapperUrl` fails | mirror not used | same | | `MVNW_USERNAME` / `MVNW_PASSWORD` set | mirror not used | same | | jar already present | nothing downloaded | same | | real download from Central, no fakes | jar ok, mirror not used | same | With the SHA-256 check removed, the wrong-file case fails, so the check is covered. `git diff --check` is clean. Fork CI on this branch: [Build](https://github.com/SEPURI-SAI-KRISHNA/seatunnel/actions/runs/45748287301) passed. Only `mvnw` changed, so the module jobs were skipped; the Code style job ran the new `mvnw`, which downloaded the jar from Maven Central as before. ### Check list * [x] If any new Jar binary package adding in your PR, please add License Notice according [New License Guide](https://github.com/apache/seatunnel/blob/dev/docs/en/developer/new-license.md) (no new jar) * [x] If necessary, please update the documentation to describe the new feature. https://github.com/apache/seatunnel/tree/dev/docs (not needed) * [x] If necessary, please update `incompatible-changes.md` to describe the incompatibility caused by this PR. (not needed) * [x] If you are contributing the connector code, please check that the following files are updated: (not a connector) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
