square-java-sdk
square-java-sdk copied to clipboard
Apimatic dependency needs jakarta namespace upgrade
Describe the bug There are a problem using Square SDK in a project that uses jakarta namespace, it fails trying to load javax.json.JsonException class
Expected behavior It doesn't fail
To Reproduce Steps to reproduce the bug:
- Check out this project https://github.com/zeppelinux/square-okhttp-problem
- mvn clean compile quarkus:dev
- Navigate to http://localhost:8080/hello
Square SDK version 28.0.0.20230419
Additional context I already created an issue for Apimatic https://github.com/apimatic/core-lib-java/issues/66 this one is for updating Square SDK when apimatic:core is updated.
I forked the io.apimatic:core and ported (tests are running from IDE but failing on some class jacoco class version) it to io.apimatic:jakarta-core:0.4.2 here https://github.com/zeppelinux/core-lib-java/tree/feature/port-to-jakarta
If anybody is in the same situation and io.apimatic:core repository is still not ported by Apimatic - install it locally, by checking out my project: mvn clean compile package install -DskipTests=true
and refer to it in your pom.xml by:
<dependencyManagement>
<dependency>
<groupId>com.squareup</groupId>
<artifactId>square</artifactId>
<exclusions>
<exclusion>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
</exclusion>
<exclusion>
<groupId>io.apimatic</groupId>
<artifactId>core</artifactId>
</exclusion>
</exclusions>
</dependency>
...
<dependencies>
<dependency>
<groupId>com.squareup</groupId>
<artifactId>square</artifactId>
<version>28.0.0.20230419</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>5.0.0-alpha.11</version>
</dependency>
<dependency>
<groupId>io.apimatic</groupId>
<artifactId>jakarta.core</artifactId>
<version>0.4.2</version>
</dependency>
...
Hey @zeppelinux
Thanks for this write up and opening the issue. I'll bring this issue up with our SDK generator team and come back to here when I have updates. In the meantime I appreciate you posting a work around for fellow community members to use!
Cheers!