A number of AWS Java SDK modules share packages across modules. For example, the aws-java-sdk-iam and aws-java-sdk-kms modules both split the com.amazonaws.auth.policy.actions package across multiple JAR files. There are several instance of this type of behavior beyond just these two modules.
This presents a significant incompatibility with Java Platform Module System as package splitting across modules is forbidden. This is a significant barrier to moving beyond Java 8.
The issue exists even with gradle. We have to complete exclude module-info to use aws sdk.
We will be addressing this in V2 to be compatible with OSGI and Java module system. Unfortunately there isn't anything we can do in V1. You can check out the osgi module which is a bundle of the entire SDK which avoids this problem.
So does this mean that V1 won't support anything newer than Java 8?
Why don't just create a central policy.actions module or specific package names.
Is there any technical reason why the shared package cannot be extracted into its own jar? The reason I ask is if there isn't then there's nothing stopping me forking the code and building my own java 9 modules compliant version.
The reality is now my whole code base is basically stuck on java 8 just because I use aws sdk... and I have to wait for version 2...
Marking this as feature request. I have added this to our internal backlog. We are currently busy with v2 and I am not sure when we will get to this.
@michaelwiles
Is there any technical reason why the shared package cannot be extracted into its own jar?
I don't see any technical blocker for this. As some packages are shared by many modules, we need to make sure existing applications are not broken by the changes.
As workaround you can use the AWS SDK for Java Bundle as Automatic Java 9 module. The bundle is an Ueber-Jar that contains the whole AWS SDK including it's dependencies (re-packaged); with the bundle I managed to use the aws sdk as automatic Java 9 module.
@see https://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk-bundle
@orielmaute , aws-java-sdk-bundle does not seem to be valid module, 1.11.438 at least...
$ which jar
$HOME/java/jdk-11+28/bin/jar
~/.m2/repository/com/amazonaws/aws-java-sdk-bundle/1.11.438$ jar --file aws-java-sdk-bundle-1.11.438.jar --describe-module
Unable to derive module descriptor for: aws-java-sdk-bundle-1.11.438.jar
Provider class com.fasterxml.jackson.core.JsonFactory not in module
It looks to me that they repackaged Jackson to com.amazonaws.thirdparty, but left META-INF/services/ around that are pointing nowhere. Do you think we should open a ticket with them?
We are fixing the package splitting in 2.x, but will not be making changes in the 1.x series to support this, because we're trying to concentrate our developer effort on 2.x.
Most helpful comment
@orielmaute , aws-java-sdk-bundle does not seem to be valid module, 1.11.438 at least...
It looks to me that they repackaged Jackson to com.amazonaws.thirdparty, but left META-INF/services/ around that are pointing nowhere. Do you think we should open a ticket with them?