open-eid / digidoc4j

DigiDoc for Java. Javadoc:
http://open-eid.github.io/digidoc4j
GNU Lesser General Public License v2.1
73 stars 39 forks source link

Exclude logback.xml from built JAR #17

Closed mihkels closed 7 years ago

mihkels commented 8 years ago

We are using Spring Boot in our project and it provides default logback.xml configuration but when we added DigiDoc4J maven dependency it overrided the Spring Boot logback configuration.

I do expect to see something like below:

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::             (v1.4.0.M2)

2016-04-26 13:13:38.686  INFO 75023 --- [           main] e.o.siva.sample.SivaDemoApplication      : Starting SivaDemoApplication on MacBook-Pro-2.local with PID 75023 (/Users/*** started by *** in /Users/***)
2016-04-26 13:13:38.691  INFO 75023 --- [           main] e.o.siva.sample.SivaDemoApplication      : No active profile set, falling back to default profiles: default
2016-04-26 13:13:38.745  INFO 75023 --- [           main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@1e730495: startup date [Tue Apr 26 13:13:38 EEST 2016]; root of context hierarchy
2016-04-26 13:13:39.233  INFO 75023 --- [           main] o.s.b.f.s.DefaultListableBeanFactory     : Overriding bean definition for bean 'beanNameViewResolver' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/ErrorMvcAutoConfiguration$WhitelabelErrorViewConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter; factoryMethodName=beanNameViewResolver; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration$WebMvcAutoConfigurationAdapter.class]]
2016-04-26 13:13:39.407  INFO 75023 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'com.domingosuarez.boot.autoconfigure.jade4j.Jade4JAutoConfiguration$DefaultTemplateResolverConfiguration' of type [class com.domingosuarez.boot.autoconfigure.jade4j.Jade4JAutoConfiguration$DefaultTemplateResolverConfiguration$$EnhancerBySpringCGLIB$$363caedf] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2016-04-26 13:13:39.537  INFO 75023 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'defaultSpringTemplateLoader' of type [class de.neuland.jade4j.spring.template.SpringTemplateLoader] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2016-04-26 13:13:39.540  INFO 75023 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'defaultJadeConfiguration' of type [class de.neuland.jade4j.JadeConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)

But the output looks like this:

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::             (v1.4.0.M2)

26.04.2016 13:18:02.305 INFO  [main] [e.o.siva.sample.SivaDemoApplication.logStarting:48] - Starting SivaDemoApplication on MacBook-Pro-2.local with PID 75047 (/Users/***/target/classes started by *** in /Users/***)
26.04.2016 13:18:02.308 INFO  [main] [e.o.siva.sample.SivaDemoApplication.logStartupProfileInfo:665] - No active profile set, falling back to default profiles: default
26.04.2016 13:18:02.370 INFO  [main] [o.s.b.c.e.AnnotationConfigEmbeddedWebApplicationContext.prepareRefresh:580] - Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@72057ecf: startup date [Tue Apr 26 13:18:02 EEST 2016]; root of context hierarchy
26.04.2016 13:18:02.718 INFO  [background-preinit] [o.h.validator.internal.util.Version.<clinit>:30] - HV000001: Hibernate Validator 5.2.4.Final

I propose to exclude logback.xml from DigiDoc4J JAR

rvillido commented 8 years ago

Thanks. I have created a Pivotal ticket for this https://www.pivotaltracker.com/story/show/118379881

rvillido commented 8 years ago

This issue has been fixed and will be included in the next release.

siimp commented 7 years ago

This issue is still causing problems in our Spring Boot project. logback.xml still exists in jar and is overriding our logging configuration. We are using spring boot 1.5.6 with gradle and digidoc4j 1.0.6

gybandi commented 7 years ago

@rvillido I also have the same issue as @siimp . It seems logback.xml re-appeared in release 1.0.6. I've solved our issue by reverting to 1.0.5 until it is fixed.

nostneji commented 7 years ago

Jep, somehow we managed to include logback.xml again, sorry! The next release will be without it.

gybandi commented 7 years ago

No problem, thanks for the quick response ;)

nostneji commented 7 years ago

In release 1.0.7 the logback configuration file logback.xml is removed from digidoc4j.jar file. It is still in digidoc4j-util.jar in order to reduce amount of generated log.