IBM / ibm-cos-sdk-java

ibm-cos-sdk-java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove split packages

pwinckles opened this issue · comments

The library cannot be used out of the box in modularized projects (Java 9+) because ibm-cos-java-sdk-core and ibm-cos-java-sdk-s3 both export the package com.ibm.cloud.objectstorage.auth, which Jigsaw does not allow.

I'll investigate this and get back to you soon.

Thanks!

Here's the workaround to get the current library working with Jigsaw in a Maven based project.

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.8.1</version>
    <configuration>
        <source>${java.version}</source>
        <target>${java.version}</target>
        <compilerArgs>
            <arg>--patch-module</arg>
            <arg>ibm.cos.java.sdk.core=${settings.localRepository}/com/ibm/cos/ibm-cos-java-sdk-s3/${ibm.cos.version}/ibm-cos-java-sdk-s3-${ibm.cos.version}.jar</arg>
        </compilerArgs>
    </configuration>
</plugin>
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.22.2</version>
    <configuration>
        <argLine>--patch-module ibm.cos.java.sdk.core=${settings.localRepository}/com/ibm/cos/ibm-cos-java-sdk-s3/${ibm.cos.version}/ibm-cos-java-sdk-s3-${ibm.cos.version}.jar</argLine>
    </configuration>
</plugin>

Edit: However, I still haven't figured out the necessary configuration to make it work in Intellij...

Hi @pwinckles,
Thanks for the workaround.
For the main issue, I've found this AWS Java SDK ticket which is the same issue. As the IBM Java SDK is a fork of the AWS SDK, if Amazon fix the issue we will port this fix to our SDK. We are not planning on diverging from the AWS SDK and fixing this issue separately.
In our roadmap we are also planning on moving to our re-architected version, so I've raised this issue to ensure it does not exist in the new architecture.
As you have provided a workaround for the issue, we'll get this documented so I've passed this issue onto our docs team also.
If you are happy with this please close this ticket, otherwise if you have any further questions/issues I'll be happy to help.

Hi @pwinckles,
I've actioned the above items, if there is anything further you need help with please let me know, otherwise I'll close this ticket soon.

Yes, that's fine. You can close the ticket. Will the AWS V2 client ever be an option to use?

Unlikely, there are no plans at present for AWS V2. Thanks for the quick response, I'll close this ticket.