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

current swagger-springmvc v0.8.8 adds unnecessary scala (extra 7MB size) dependency to war/jar #1064

Closed
aldas opened this issue Jan 30, 2015 · 6 comments · Fixed by #1108
Closed
Assignees
Milestone

Comments

@aldas
Copy link

aldas commented Jan 30, 2015

gradle.properties has swagger_springmvc_version=0.8.8 this version of swagger has eventually dependcy to "org.scala-lang:scala-library:2.10.0" which is ~7MB. This is unnecessary according to json4s/json4s#108

+--- com.mangofactory:swagger-springmvc:0.8.8
|    +--- com.wordnik:swagger-core_2.10:1.3.5
|    |    +--- commons-lang:commons-lang:2.4 -> 2.6
|    |    +--- org.slf4j:slf4j-api:1.6.3 -> 1.7.7
|    |    +--- com.fasterxml.jackson.core:jackson-annotations:2.1.5 -> 2.4.0
|    |    +--- com.fasterxml.jackson.module:jackson-module-jsonSchema:2.1.0
|    |    |    +--- com.fasterxml.jackson.core:jackson-databind:2.1.0 -> 2.4.4 (*)
|    |    |    +--- com.fasterxml.jackson.core:jackson-core:2.1.0 -> 2.4.4
|    |    |    \--- com.fasterxml.jackson.core:jackson-annotations:2.1.0 -> 2.4.0
|    |    +--- com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:2.0.0
|    |    |    +--- com.fasterxml.jackson.core:jackson-core:2.0.0 -> 2.4.4
|    |    |    +--- com.fasterxml.jackson.core:jackson-databind:2.0.0 -> 2.4.4 (*)
|    |    |    +--- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.0.0
|    |    |    |    +--- com.fasterxml.jackson.core:jackson-core:2.0.0 -> 2.4.4
|    |    |    |    \--- com.fasterxml.jackson.core:jackson-databind:2.0.0 -> 2.4.4 (*)
|    |    |    \--- javax.ws.rs:jsr311-api:1.1.1
|    |    +--- com.wordnik:swagger-annotations:1.3.5
|    |    +--- org.json4s:json4s-ext_2.10:3.2.5
|    |    |    +--- org.scala-lang:scala-library:2.10.0

maybe swagger springmvc version should/could be pumped to 0.9.x series?

@aldas
Copy link
Author

aldas commented Jan 30, 2015

this way war size drops from 42MB to 35MB

@atomfrede
Copy link
Member

@aldas Have you excluded scala-library from swagger-springmvc dependency? I tried it and get com/wordnik/swagger/model/ApiInfo.class): warning: Cannot find annotation method 'bytes()' in type 'ScalaSignature': class file for scala.reflect.ScalaSignature not found

Nevertheless compilation succeeds, but there are test failures (a lot of ClassNotFoundException). Using the latest 0.9.x doesn't work either for me here as ApiInfo is not available anymore. So it looks like scala-library is required right now.

@jdubois The maven build should add scala-library too (as it not excluded), is that correct?

@aldas
Copy link
Author

aldas commented Feb 7, 2015

I think "ApiInfo" has been moved to different package in 0.9.x. I tried excluding various scala things in gradle but eventually changed swagger version as someday I need to upgrade it anyway.

As I recall all I needed to get things working was to use import com.mangofactory.swagger.models.dto.ApiInfo; import.

@aldas
Copy link
Author

aldas commented Feb 7, 2015

I think that from swagger-springmvc 0.9.5 (commit springfox/springfox@e426cd1#diff-763c874365a7bc898858eaa1aeee307a ) com.wordnik.swagger.model.ApiInfo; was removed and replaced with com.mangofactory.swagger.models.dto.ApiInfo; class

@atomfrede
Copy link
Member

Ah thanks, IDEA didn't pick up the change in my gradle file correctly, so I couldn't quick-fix the changed package. I'll provide a pull request during the weekend for both maven and gradle as it reduces the size of war file ~ 10MB (59mb before, now 49mb).

atomfrede referenced this issue in atomfrede/generator-jhipster Feb 8, 2015
Using new version removes scala dependency and reduces .war size by 9-10MB

Close #1064
@jdubois jdubois modified the milestone: 2.2.0 Feb 12, 2015
@kumaresan-perumal
Copy link

thanks @atomfrede

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

Successfully merging a pull request may close this issue.

4 participants