zoukankan      html  css  js  c++  java
  • 关于springboot项目的jar和war两种打包方式部署的区别

    关于springboot项目的jar和war两种打包方式部署的区别

    关于springboot项目的jar和war两种打包方式部署的区别?

    https://bbs.csdn.net/topics/392493467

    1.我的一个springboot项目,用mvn install打包成jar,换一台有jdk的机器就直接可以用java -jar 项目名.jar的方式运行,没任何问题,为什么这里不需要tomcat也可以运行了?

    <dependency>

        <groupId>org.springframework.boot</groupId>

        <artifactId>spring-boot-starter-web</artifactId>

    </dependency>

    依赖下面这个:

    <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-tomcat -->

    <dependency>

        <groupId>org.springframework.boot</groupId>

        <artifactId>spring-boot-starter-tomcat</artifactId>

        <version>2.1.6.RELEASE</version>

    </dependency>

    这个又依赖下面这几个:

    Apache 2.0 org.apache.tomcat.embed » tomcat-embed-core

    Apache 2.0 org.apache.tomcat.embed » tomcat-embed-el

    Apache 2.0 org.apache.tomcat.embed » tomcat-embed-websocket

    所有 最终 还是有依赖tomcat的,只不过是内置的

    要是打war包,是要排除内置的tomcat的

    spring boot 打成jar包的时候,你可以看一下pom文件,在pom里面有一些tomcat的jar包引用,就是Spring boot内置的tomcat,

    打war包时,需要注释掉这些tomcat的引用

  • 相关阅读:
    获取CheckBox的Text值
    动态绑定数据至Html Table
    二次事件并细化功能
    ASP.NET MVC的JavaScriptResult
    Google Earth 8.0
    ASP.NET MVC的ContentResult
    ASP.NET MVC使用input标签上传文件
    处理动态SQL语句的参数
    Infor SyteLine如何快速锁定用户
    执行git push出现"Everything up-to-date"
  • 原文地址:https://www.cnblogs.com/feng9exe/p/11401768.html
Copyright © 2011-2022 走看看