Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could you provide a shadowJar version of the Bing API SDK #206

Open
suxuan-king1 opened this issue Nov 20, 2024 · 5 comments
Open

Could you provide a shadowJar version of the Bing API SDK #206

suxuan-king1 opened this issue Nov 20, 2024 · 5 comments

Comments

@suxuan-king1
Copy link

Could you provide a shadowJar version of the Bing API SDK? The new version of the SDK depends on several JAR packages that conflict with other frameworks used in our project.
The Google Ads SDK provides a shadowJar version(https://mvnrepository.com/artifact/com.google.api-ads/google-ads-shadowjar), which has brought great convenience for our integration with the Google Ads API.

@xinyuwen2
Copy link
Collaborator

Hi, thank you for the suggestion! We won't provide a version-specific shadow jar. Could you try pom_for_shadow_jar.xml to package it? It works well on my local. If you encounter any other issues please feel free to ask here.

@suxuan-king1
Copy link
Author

suxuan-king1 commented Jan 6, 2025

Thank you very much for your attention.
I tried packaging with the shadow jar pom_for_shadow_jar.xml and found that the final generated jar only includes all the third-party dependencies of the Bing Ads SDK, without relocating the package paths, so it didn't resolve the conflict issue. For example, our project depends on com.sun.xml.ws 2.3.3, which conflicts with jakarta.xml.ws 3.0.0 from the Bing Ads SDK. It seems that this is because the relocations rules were not configured in the maven-shade-plugin?

@xinyuwen2
Copy link
Collaborator

Just updated pom_for_shadow_jar.xml to relocate all dependencies. Noticed that the META-INF/cxf/bus-extensions.txt file aren't aggregated properly and loaded properly and the class names cannot be relocated by ServicesResourceTransformer. I added my-bus-extensions.txt to replace it. Could you try it again?

@suxuan-king1
Copy link
Author

suxuan-king1 commented Jan 7, 2025

Thank you for your attention.

  1. It seems that some directories and packages were not successfully shaded, as shown in the image.
  2. Resource files were also not successfully shaded, such as META-INF/cxf/org.apache.cxf.bus.factory.
  3. my-bus-extensions.txt does not seem to be a good solution. Could it potentially lead to hidden issues when upgrading Apache CXF in the future?
    2025-01-07 16 34 46

@xinyuwen2
Copy link
Collaborator

Hi, thank you for pointing out these issues. I updated the pom to relocate all packages.

For META-INF/cxf/org.apache.cxf.bus.factory, I don't find a transformer to process it. Looks like cxf is so special and it's not easy to relocate. Also I agree that my-bus-extensions.txt is not a good but let's treat it as a temporary solution. I'll update it if there's a better way. However, even the resource files under META-INF/cxf are not shaded, the package works well for me. If you're encountering some issues please tell me.

Btw there's one thing confused me, seems in google shadowJar it doesn't relocate any packages. Wondering why it can solve conflicts...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants