springboot embedded tomcat and tomcat-embed-jasper

前端 未结 2 1277
一生所求
一生所求 2020-12-29 07:43

I sometimes see these following declaration in pom.xml...

   
    
        org.springframework.boot

        
相关标签:
2条回答
  • 2020-12-29 08:10

    Extended from jcgarcia's answer.

    Even it is provided, but when you build as war, spring-boot-maven-plugin will include two more jar : ecj-3.12.3.jar tomcat-embed-jasper-8.5.23.jar

    0 讨论(0)
  • 2020-12-29 08:22

    As you said, the spring-boot-starter-web includes the spring-boot-starter-tomcat. You could check it here

    The spring-boot-starter-tomcat includes the tomcat-embed-core. You could check it here

    But, seems like tomcat-embed-core doesn't include tomcat-embed-jasper. In fact, is tomcat-embed-jasper who includes dependency with tomcat-embed-core. Check it here

    Anyway, the tomcat-embed-jasper is marked as provided, so indicates that you expect the JDK or a container to provide the dependency at runtime. This scope is only available on the compilation and test classpath, and is not transitive.

    In conclusion, the spring-boot-starter-web includes the tomcat embedded dependency but it doesn't includes the jasper embedded dependency, so that should be the reason to declare it separately.

    Also, remember that using Spring IO Platform as parent you are able to manage dependencies easily. To know more about this you could read my post

    Hope it helps,

    0 讨论(0)
提交回复
热议问题