-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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-core Scala dependencies excessive size #624
Comments
@raspacorp - swagger-core is written almost exclusively in scala (except for the annotations), so removing the scala dependencies will pretty much break everything. Currently, there's not much you can do (unless you have several WAR files in which case you can install some dependencies on your application server directly). Actually, even if you have a single WAR, you can deploy these dependencies as part of your environment build-up rather than your WAR (depending on the way you work). Future (major) versions of swagger-core may migrate completely to Java and remove the scala dependencies, however, no date can be given as to when. |
I was able to remove some dependencies and reduced almost 19MB of size, so far the api-docs is working fine, however I will keep testing. This is the dependency with the exclusions (scalap has transitive dependencies so when removed it also removes scala-compiler and scala-reflect):
|
Almost one month using it with removed dependencies and everything seems to work well, with a small API with 20 operations with GET, PUT, POST and DELETE methods. I will close the issue. |
Hi @raspacorp, Please re-open this ticket. The library should be migrated to pure java – pulling in an entire Scala compiler etc is clearly excessive... Thanks, |
@phraktle - the only scala dependencies are for testing. It has zero effect on the compiled output. No need to reopen it. |
Hi @webron, Based on the dependency graph below, there are still scala dependencies in the released modules. Or am I using some outdated version? Thanks,
|
Yes, that's because it's version 1.3.12 which was written in scala, not Java. The 1.5.x versions are the Java based ones. |
Thanks @webron! I have missed that update due to the artifact renaming. |
Before adding swagger tool my war file was 8.7 MB, after adding swagger now it is 39MB. My manager will complain about that, do you have a minified version or something?
It seems that the scala dependencies are the bigger ones: scala-compiler, scala-reflect, scala-library, jackson-module-scala.
I am using swagger-jersey2-jaxrs_2.10 via maven, as I am not using scala in my project should I exclude those jars? I don't know if that would break something.
The text was updated successfully, but these errors were encountered: