aws-sdk-java-v2 icon indicating copy to clipboard operation
aws-sdk-java-v2 copied to clipboard

[GraalVM] Broad pattern in sdk-core resource-config.json

Open bipe15 opened this issue 5 months ago • 0 comments

Describe the bug

Reported already in #6488 as a question

.class files are included in the final image as resources.

In my opinion, it does not make much sense since a .class file won't be accessed as a resource, as it is already a binary executable.

I found the source of all of this in sdk-core resource-config.json. There is a directive to include all under software/amazon/awssdk/

{
  "resources": {
    "includes": [
      {
        "pattern": "software/amazon/awssdk/services/\\w+/execution.interceptors"
      },
      {
        "pattern": "software/amazon/awssdk/.*"
      }
    ]
  }
}

Regression Issue

  • [ ] Select this option if this issue appears to be a regression.

Expected Behavior

Do not include .class files as resources in the binary executable

Current Behavior

.class files are included in the binary executable.

Reproduction Steps

Build as native-image optionally with --emit build-report to see the resources included

Possible Solution

sdk-core resource-config.json

{
  "resources": {
    "includes": [
      {
        "pattern": "software/amazon/awssdk/services/\\w+/execution.interceptors"
      }
    ]
  }
}

Additional Information/Context

I was using S3, Bedrock, Textract, SNS, SQS and SES services; the reduction was ~35MB

AWS Java SDK version used

2.35.10

JDK version used

24

Operating System and version

linux

bipe15 avatar Nov 24 '25 13:11 bipe15