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

Add module-info.java

Open hrchu opened this issue 8 years ago • 10 comments

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.

hrchu avatar Oct 18 '17 07:10 hrchu

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

polle avatar Jan 15 '18 13:01 polle

so whats the solution for now ?

hookla avatar Apr 23 '18 15:04 hookla

The real issue here is split packages, effectively rendering the SDK unusable in a JPMS (jdk9 or later) runtime.

rferreira avatar May 26 '18 23:05 rferreira

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..

damnhandy avatar Jul 01 '18 22:07 damnhandy

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.

jhg023 avatar Dec 27 '18 21:12 jhg023

This is still a problem as of 1.11.480, the latest version on maven central

akud avatar Jan 13 '19 22:01 akud

Any update on this issue?

edusasse avatar Nov 16 '19 21:11 edusasse

Hey I'm migrating to jdk 11, is there any update about this ?

rosanas88 avatar Dec 04 '19 19:12 rosanas88

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.

akud avatar Dec 05 '19 16:12 akud

Thank you @akud! Worked fine.

rosanas88 avatar Dec 06 '19 01:12 rosanas88

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

debora-ito avatar Jul 12 '24 23:07 debora-ito

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.

github-actions[bot] avatar Jul 12 '24 23:07 github-actions[bot]