当前位置:   article > 正文

Springboot打包_springboot 打包

springboot 打包
  • Spring boot打war部署到tomcat上

    - 第一步
    
      ```
      @MapperScan("com.yglh.mapper")
      @SpringBootApplication
      public class YglhApplication extends SpringBootServletInitializer {
      
          public static void main(String[] args) {
      
              SpringApplication.run(YglhApplication.class, args);
          }
      
          @Override
          protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
              return builder.sources(YglhApplication.class);
          }
      
      }
      ```
    
    - 第二步,pom
    
      ```
          <packaging>war</packaging>
      ```
    
    - maven插件执行、package打包
    
      ```
      [INFO] Webapp assembled in [1048 msecs]
      [INFO] Building war: D:\git\gitlab\2021\夜歌离火\teacherhelper-common\target\yglh-0.0.1-SNAPSHOT.war
      [INFO] 
      [INFO] --- spring-boot-maven-plugin:2.1.3.RELEASE:repackage (repackage) @ yglh ---
      [INFO] Replacing main artifact with repackaged archive
      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD SUCCESS
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time:  8.573 s
      [INFO] Finished at: 2021-03-30T12:03:14+08:00
      [INFO] ------------------------------------------------------------------------
      ```
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/522513
推荐阅读
相关标签
  

闽ICP备14008679号