Skip to content

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

Description

@bipe15

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

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.graalvm

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions