swagger-api/swagger-core

Swagger-servlet includes logback-test.xml in classpath

tirsoh opened this issue · 9 comments

Looks like the swagger-servlet 1.5.9 dependency includes a logback-test.xml file on the classpath. This is not a good practice because logback will pick this logback file over the consumers logback.xml configuration. Can someone please remove this from the final JAR so that it doesn't override consumer's logback configuration?

+1

+1

There is an exclusion for logback now

Hi,
I am still facing this issue while using below dependencies:-
compile group: 'io.swagger', name: 'swagger-models', version: "1.5.15"
compile group: 'io.swagger', name: 'swagger-servlet', version: "1.5.15"

I'm also facing this issue. I see in the pom file for swagger-servlet the <exclude>logback.xml</exclude> but swagger-servlet contains a logback-test.xml file in /src/main/resources

try this:
' <dependency> <groupId>io.swagger</groupId> <artifactId>swagger-servlet</artifactId> <version>${swagger.version}</version> <exclusions> <exclusion> <groupId>ch.qos.logback</groupId> <artifactId>logback-api</artifactId> </exclusion> <exclusion> <groupId>ch.qos.logback</groupId> <artifactId>logback-core</artifactId> </exclusion> <exclusion> <groupId>ch.qos.logback</groupId> <artifactId>logback-access</artifactId> </exclusion> </exclusions> </dependency>

@phomlish that doesn't work or change anything because swagger-servlet defines its logback dependencies with <scope>provided</scope>. That being said, it's not even the logback dependency causing the problem, it's the physical file logback-test.xml that exists in /src/main/resources which is then being packaged with swagger-servlet-1.5.16.jar. If I have time I'll fork swagger-core and open a pull request that simply moves the file from /src/main/resources to /test/main/resources in the swagger-servelet module which will fix the problem.

@fehguy since you were last to close this issue... I'm wondering, given the information here and the pull request, whether you still believe the issue should be considered "closed"

@fehguy is there any update on this issue... it would be great to have a fix so that the hosting application no longer needs to override logback config file location... Thanks.