Closed smart-nick closed 5 years ago
Hi @smart-nick, I understand the issue but unfortunately we cannot make this change without breaking backward compatibility, we'll have to keep shading all the dependencies, even the ones exposed directly.
A possible workaround may be shading the SDK when working with the extended sqs client lib.
Closing this, feel free to reopen if you have further questions.
here some workaround for people like me that try to solve this problem:
use this relocation on your final jar builder in maven. There is a similar solution using gradle but I don't know the syntax. This at least worked for me but as described this is a dirty hack.
<configuration>
<relocations>
<relocation>
<pattern>org.apache.commons.logging</pattern>
<shadedPattern>com.amazonaws.thirdparty.apache.logging</shadedPattern>
</relocation>
</relocations>
aws-java-sdk-bundle
has this relocation pattern:The problem is, this SDK has publicly exposed methods that use
org.apache.commons.logging
. Specifically, the IOUtils.closeQuiety(Closeable is, Log log) takes a log parameter from that library. When it gets shaded, ajava.lang.NoSuchMethodError
is thrown since you are passing inorg.apache.commons.logging.Log
instead ofcom.amazonaws.thirdparty.apache.logging.Log
. I ran into this issue with the extended sqs client lib; there is an issue here for that. I think it would be preferable to remove the relocation pattern I listed above from aws-java-sdk-bundle so that the shading only effects the internals of the SDK instead of publicly exposed methods.