Maven patches can only be delivered as the main jar: hpi, aar, war and typed dependencies have no path
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 20/100
Research direction
Start with the type check in crates/socket-patch-core/src/patch/redirect/mod.rs, which refuses any Maven type other than jar, and the handling of non-jar types in crates/socket-patch-core/src/formats/maven/mod.rs. The issue lists three options, from failing loudly on non-main-jar targets to carrying the file extension through the rewriter and handling nested jars in .hpi and .aar files. Done means a maintainer has chosen one option, and that choice is reflected in the refusal warnings or the served tree. The issue is a design question, so settle the scope with maintainers before writing code.
Written by the indexing model from the issue text.
Description
[agent] Filed after a read-only review of the CLI source at 02add9be (main). Nothing was executed; the claims below come from reading the code.
Summary
A Maven patch can be delivered only as the main <artifactId>-<version>.jar. Artifacts whose users consume another file have no working path in hosted or vendored mode, and only a partial one in agent mode:
| Artifact kind | What users run | Agent mode | Hosted / vendored |
|---|---|---|---|
Jenkins plugin (hpi/jpi) |
classes inside the .hpi, under WEB-INF/lib/<artifactId>.jar |
the companion <artifactId>-<version>.jar in the cache can be patched; the .hpi copy Jenkins loads is not addressed |
a dependency with <type>hpi</type> is refused; the served tree holds only .jar and .pom |
Android library (aar) |
classes.jar inside the .aar, and the copy Gradle extracts into its transforms cache |
an .aar is treated as an opaque archive; the nested classes.jar and the extracted copy are not patched; a version directory that holds only an .aar is not discovered |
<type>aar</type> is refused, and Android Gradle builds are refused as a whole |
war, or a dependency that declares <type>bundle</type> |
the typed file | not checked here | refused: the rewriter accepts only jar (and pom) |
The refusals are warnings on a skipped dependency, so a project can look patched while the file that runs is unchanged. For Jenkins that means a patched compile class path and an unpatched running controller.
Where
- Hosted Maven accepts a
<type>only when it isjar:crates/socket-patch-core/src/patch/redirect/mod.rs(if typ != "jar"), andcrates/socket-patch-core/src/formats/maven/mod.rstreats any other non-empty type as not redirectable. - No code path looks inside a nested archive for a class-level record (
WEB-INF/lib/*.jarin an.hpi,classes.jarin an.aar); a search ofcrates/socket-patch-core/srcfinds no handling of either layout. - This is separate from #1069 (upstream files fetched only from Maven Central), which also affects these artifacts because most of them are published in other repositories.
What would close it
Any one of these, in order of size:
- State the limit and fail loudly: refuse a patch whose target is not a main jar with a named code, and say in the scan output that the runtime copy of a Jenkins plugin or an Android library is not covered.
- Carry the artifact's file extension from the patch record into the rewriter and the served tree, so a typed dependency whose file is in fact a jar (
bundle) or a whole-file replacement (hpi,aar,war) can be redirected. - Cover the nested copies: a record that names the nested jar member of an
.hpior theclasses.jarof an.aar, and detection of Gradle's extracted copies.
Context: the patch service is starting to build patches for artifacts published outside Maven Central (Jenkins, XWiki, Google's Maven repository). Plain jars from those repositories are found and patched by coordinates today, whatever repository they came from; this issue is about the other packaging kinds.
- Dominant language
- Rust
- Stars
- 9
- Forks
- 2
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 313
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from SocketDev/socket-patch
-
agent:triaged arch-audit bug priority:p2
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
SocketDev/socket-patch#2306 ·
Maintainers usually reply within 1 day
-
agent:triaged arch-audit bug priority:p3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
SocketDev/socket-patch#2296 ·
Maintainers usually reply within 1 day
-
agent:needs-human agent:triaged ci-janitor priority:p1
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SocketDev/socket-patch#2270 · 3 comments ·
Maintainers usually reply within 1 day
-
agent:triaged arch-audit bug priority:p1
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
SocketDev/socket-patch#2259 ·
Maintainers usually reply within 1 day
-
agent:triaged arch-audit priority:p3 refactor
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
SocketDev/socket-patch#1860 ·
Maintainers usually reply within 1 day
All issues in SocketDev/socket-patch
Similar issues
-
Bash init calls `cygpath` unconditionally on Windows, which breaks non-Cygwin shells like `brush`Possibly taken @iliqiliev claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ajeetdsouza/zoxide#1381 ·
Maintainers usually reply within 5 days
-
triage
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
kornia/kornia-rs#1416 · 1 comment ·
Maintainers usually reply within 2 days
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
paritytech/revive#749 ·
Maintainers usually reply within 3 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
swc-project/swc-next-issues#1043 ·