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

swagger-jaxrs2-servlet-initializer contains classes from swagger-jaxrs2 #3412

Closed
zregvart opened this issue Jan 14, 2020 · 1 comment
Closed

Comments

@zregvart
Copy link

Seems that some classes are duplicated from swagger-jaxrs2 to swagger-jaxrs2-servlet-initializer:

io.swagger.v3.jaxrs2.integration.JaxrsAnnotationScanner
io.swagger.v3.jaxrs2.integration.JaxrsApplicationAndAnnotationScanner
io.swagger.v3.jaxrs2.integration.JaxrsApplicationAndResourcePackagesAnnotationScanner
io.swagger.v3.jaxrs2.integration.JaxrsApplicationScanner
io.swagger.v3.jaxrs2.integration.JaxrsOpenApiContext
io.swagger.v3.jaxrs2.integration.JaxrsOpenApiContextBuilder
io.swagger.v3.jaxrs2.integration.OpenApiServlet
io.swagger.v3.jaxrs2.integration.ServletConfigContextUtils
io.swagger.v3.jaxrs2.integration.ServletOpenApiConfigurationLoader
io.swagger.v3.jaxrs2.integration.ServletOpenApiContextBuilder
io.swagger.v3.jaxrs2.integration.ServletPathConfigurationLoader
io.swagger.v3.jaxrs2.integration.SwaggerLoader
io.swagger.v3.jaxrs2.integration.XmlWebOpenApiContext

I don't see any configuration of shading or jarjar-ing in /modules/swagger-jaxrs2-servlet-initializer/pom.xml and there the sources for this are missing in the swagger-jaxrs2-servlet-initializer-2.1.1-sources.jar so that makes me thing this was done manually.

Any explanation as to why was this done and what purpose does it serve?

frantuma added a commit that referenced this issue Mar 20, 2020
frantuma added a commit that referenced this issue Mar 20, 2020
refs #3412 - deprecate swagger-jaxrs2-servlet-initializer add alternative with different package
@frantuma
Copy link
Member

Thanks a lot for reporting this! Unfortunately this is related to an issue with the same package used within swagger-jaxrs2 and swagger-jaxrs2-servlet-initializer, and it's impact in an OSGi env: the same package io.swagger.v3.jaxrs2.integration is exported by both bundle (the "split-package" issue in OSGi), which means that depending on the order of bundle loading in an OSGI env, one or the other will be picked up by client bundles.

If I am not mistaken, this means that we cannot unfortunately fix this (by removing the duplicated classes, currently they are added by themaven-bundle-plugin) in a minor version, as the duplication ensures the classes will be available in OSGi env.

For this reason #3412 deprecates swagger-jaxrs2-servlet-initializer and adds swagger-jaxrs2-servlet-initializer-v2 which changes the package to io.swagger.v3.jaxrs2.integration.servlet

The deprecated module will be eventually removed in next major version.

Closing ticket, please reopen if you're still experiencing issues.

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