aws / aws/aws-sdk-java-v2

Both Apache Client and Netty are included in the runtime scope by default

Aperta
#3,040 7 commenti 0 reazioni 0 assegnatari Vedi su GitHub
documentation p3
Lingua principale
Java
Stelle
2.6k
Fork
1k
Merge medio
2g 9h
PR unite (30g)
51

Descrizione

### Describe the bug

When simply including a service, say `ec2` in a Gradle build, both the Apache Client and Netty get pulled in as runtime transitive dependencies by default.

This is due to https://github.com/aws/aws-sdk-java-v2/blob/2f4b44d7a08a4e2f0b26fe26b0325b065e4547c3/services/pom.xml#L381 and https://github.com/aws/aws-sdk-java-v2/blob/2f4b44d7a08a4e2f0b26fe26b0325b065e4547c3/services/pom.xml#L387

This then automatically gets picked up by the Gradle application plugin and needlessly includes tons of jars in the final package.

### Expected behavior

Default to a single client, preferably the plain and lightweight `url-connection-client`.

### Current behavior

Dozens of additional jars are pulled in by default.

### Steps to Reproduce

Create a new `build.gradle.kts` file and add the following dependency: `implementation("software.amazon.awssdk:ec2:2.17.131")`.

Now run `gradle dependencies` and check the `runtimeClasspath` section.

### Possible Solution

Only depend on `url-connection-client` by default.

### Context

_No response_

### AWS Java SDK version used

2.17.131

### JDK version used

17.0.2

### Operating System and version

Win11 x64

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Ispeziona services/pom.xml alle righe indicate per capire perché sia Apache Client sia Netty entrano nell’ambito di runtime. Riproduci il problema con build.gradle.kts usando la dipendenza ec2, quindi esegui gradle dependencies e controlla runtimeClasspath. Il lavoro è completato quando la dipendenza predefinita include solo il leggero url-connection-client, anziché entrambi i client e i relativi JAR aggiuntivi.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java
Ambito
build-system
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
55/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.