aws / aws/aws-sdk-java-v2

JaCoCo 0.8.13 fails to instrument DefaultSsmClient (ClassTooLargeException)

Open
#6,234 4 comments 1 reaction 0 assignees View on GitHub
cross-sdk feature-request p2
Dominant language
Java
Stars
2.6k
Forks
1k
Avg merge
2d 9h
Merged PRs (30d)
51

Description

### Describe the bug

I see this error when running a Maven build with the JaCoCo code coverage plugin, Java 21, and AWS SDK v2 version `2.31.76`, with the AWS SDK v2 SSM dependency in classpath.

```
java.lang.instrument.IllegalClassFormatException: Error while instrumenting software/amazon/awssdk/services/ssm/DefaultSsmClient with JaCoCo 0.8.13.202504020838/78d5eff`
```

### Regression Issue

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

### Expected Behavior

No error emitted

### Current Behavior

Instrumentation error emitted in maven build, see https://github.com/jpalomaki/aws-sdk-java-v2-ssm-jacoco-sscce/actions/runs/16073837387/job/45364298935#step:4:41

### Reproduction Steps

https://github.com/jpalomaki/aws-sdk-java-v2-ssm-jacoco-sscce

### Possible Solution

Can the generated code be modularized better (to not create very large classes)?

### Additional Information/Context

The issue can be worked around by adding an exclusion to the JaCoCo plugin like so:

```xml


software/amazon/awssdk/services/ssm/DefaultSsmClient

```

However, I submitted this issue because I felt that it might be better to optimize the generated code, if possible.

### AWS Java SDK version used

2.31.76

### JDK version used

openjdk version "21.0.5" 2024-10-15 LTS (corretto)

### Operating System and version

Ubuntu 24.04 and macOS 15.5

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.