Visitar URL original
Add an S3 transport built on the AWS SDK for Java 2.x by slachiewicz · Pull Request #2290 · apache/maven-resolver · GitHub
Skip to content

Add an S3 transport built on the AWS SDK for Java 2.x - #2290

Open
slachiewicz wants to merge 3 commits into
masterfrom
agent/transport-s3
Open

slachiewicz wants to merge 3 commits into
masterfrom
agent/transport-s3

Conversation

@slachiewicz

@slachiewicz slachiewicz commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Step 1 of #2289 (#2291 is the longer-term direction): a new maven-resolver-transport-s3 module on the AWS SDK for Java 2.x, next to the MinIO one, which is not touched. Once this has shipped, #2289 continues with deprecating and then dropping maven-resolver-transport-minio.

The module is the MinIO transporter ported call for call (headObject, getObject, putObject, close), with the same object name mappers under org.eclipse.aether.transport.s3, the same s3+http(s) opt-in form and the same plaintext refusal. Three things differ because the SDK makes them possible or necessary:

  • Credentials: repository authentication (username as access key, password as secret key) is used when set; without it the SDK default provider chain applies, so environment variables, profiles, container and instance roles work as they do with any AWS tool. The MinIO transporter refuses to start without repository authentication.
  • Region: a new aether.transport.s3.region key; unset, the SDK default region chain is consulted and us-east-1 is the fallback, which S3-compatible stores accept.
  • Client settings: path-style access, and requestChecksumCalculation and responseChecksumValidation set to WHEN_REQUIRED, since SDK 2.30.0 otherwise sends CRC32 trailers that MinIO-compatible stores reject (S3 default integrity protection change - version `2.30.0` aws/aws-sdk-java-v2#5802).

Only s3 and url-connection-client are depended on; the SDK's Apache, Apache 5 and Netty HTTP engines are excluded. Runtime closure measured on a scratch POM: 8.9 MB in 32 jars, against 21.2 MB in 22 jars for the MinIO client (Bouncy Castle, Guava, snappy, Kotlin, Jackson, commons-compress). Both clients are Java 8 bytecode.

The factory also accepts the MinIO transport's minio+http(s) URL form and reads its aether.transport.minio.* keys as fallbacks for the three keys the two transports share, so a repository set up for the MinIO transport works here unchanged. Its default priority is 1.0, above the MinIO factory's 0.0, so with both modules present every s3+ and minio+ repository resolves to this transporter; without this module the MinIO one keeps working as before. The deployment page lists both rows, and maven-resolver-tools picks up the new configuration keys for the generated configuration page.

Verified: mvn -pl maven-resolver-transport-s3 -am -P run-its verify on JDK 21 with Docker → BUILD SUCCESS; the integration test runs the same peek, get and put cases as the MinIO one against the same container image, plus get-to-file and put-from-file.

Step 1 of #2289: the MinIO transporter ported call for call onto the
AWS SDK, with the SDK default credential chain as fallback, a region
key, path-style access and WHEN_REQUIRED checksums so that S3-compatible
stores keep working. The MinIO module is left as it is until this one
has shipped.
A repository set up for maven-resolver-transport-minio (minio+https URL,
aether.transport.minio.* keys) then works with this transport unchanged,
which is the migration path #2289 needs before the MinIO module can go.
The s3 keys win where both are set.

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid new S3 transport module that cleanly ports the MinIO transporter to the AWS SDK 2.x with proper credential chain fallback, region handling, and insecure-protocol guardrails. Two API design points on the public SPI merit discussion before the 2.0.26 release locks them in.

Suggested milestone: 2.0.26

This review was generated by an AI agent, Hermès on behalf of @gnodet.

Comment thread src/site/markdown/deployment.md Resolved
…e review points

No mapper needs the client, and the SPI is not released yet, so it can still leave the signature without a deprecation cycle. Also fixes the create() Javadoc, documents ObjectName.normalize, and notes in deployment.md that the S3 transporter outranks the MinIO one for minio+ repositories.

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following up on my earlier review — all 4 findings have been addressed in this commit.

✅ Javadoc accuracy (ObjectNameMapperFactory.create): corrected to "Creates an ObjectNameMapper".
✅ S3Client on public SPI interface: removed from the create signature — the interface is now cleanly decoupled from the AWS SDK type.
✅ Missing Javadoc on ObjectName.normalize: Javadoc added with @param and @return.
✅ Priority interaction not documented: deployment.md now explains the priority override (aether.priority.MinioTransporterFactory).

LGTM.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants