Add module-info.java
So that projects depend on this can be published to a public artifact repository. Note that this is not breaking backward compatibility. All codes except this file can be still compiled in Java 6.
Using automatic modules only works in some cases because there are split packages. For example, the package com.amazonaws.auth exists in both aws-java-sdk-s3 and aws-java-sdk-core giving the following error:
error: module demo reads package com.amazonaws.auth from both aws.java.sdk.core and aws.java.sdk.s3
so whats the solution for now ?
The real issue here is split packages, effectively rendering the SDK unusable in a JPMS (jdk9 or later) runtime.
A relatively low-effort way of addressing this is to add an Automatic-Module-Name value to the MANIFEST.MF in each JAR file. This could be done in maven by adding something like:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<Automatic-Module-Name>com.amazonaws.aws.java.sdk.iam</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</plugin>
This doesn't get around the modules dependencies, but it helps ensure that we don't get module naming collusions, etc..
Any update(s) on this? I have some code being used from v1 (as it doesn't exist yet in v2), and I'm encountering a split package on com.amazonaws.auth.
This is still a problem as of 1.11.480, the latest version on maven central
Any update on this issue?
Hey I'm migrating to jdk 11, is there any update about this ?
I think your best bet is to use the v2 sdk if you want to do modules. I doubt they will be fixing the split packages any time soon.
Thank you @akud! Worked fine.
We don't have plans to support this in v1 before going into Maintenance Mode, so I'll go ahead and close this issue.
Java SDK v2 uses Automatic-Module-Name and doesn't have split packages, please check it out and send us any feedback or issue reports by creating a new issue in the v2 repo.
Reference:
- Announcing end-of-support for AWS SDK for Java v1.x effective December 31, 2025 - blog post
This issue is now closed.
Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.